OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/corewm/focus_controller.h" | 5 #include "ui/views/corewm/focus_controller.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "ui/aura/client/activation_change_observer.h" | 9 #include "ui/aura/client/activation_change_observer.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 ActivateWindowById(1); | 540 ActivateWindowById(1); |
541 EXPECT_EQ(1, GetFocusedWindowId()); | 541 EXPECT_EQ(1, GetFocusedWindowId()); |
542 | 542 |
543 client->RemoveObserver(observer.get()); | 543 client->RemoveObserver(observer.get()); |
544 | 544 |
545 ActivateWindowById(2); | 545 ActivateWindowById(2); |
546 EXPECT_EQ(2, GetFocusedWindowId()); | 546 EXPECT_EQ(2, GetFocusedWindowId()); |
547 ActivateWindowById(1); | 547 ActivateWindowById(1); |
548 EXPECT_EQ(1, GetFocusedWindowId()); | 548 EXPECT_EQ(1, GetFocusedWindowId()); |
549 } | 549 } |
550 virtual void ShiftFocusOnActivationDueToHide() { | 550 virtual void ShiftFocusOnActivationDueToHide() OVERRIDE { |
551 // Similar to ShiftFocusOnActivation except the activation change is | 551 // Similar to ShiftFocusOnActivation except the activation change is |
552 // triggered by hiding the active window. | 552 // triggered by hiding the active window. |
553 ActivateWindowById(1); | 553 ActivateWindowById(1); |
554 EXPECT_EQ(1, GetFocusedWindowId()); | 554 EXPECT_EQ(1, GetFocusedWindowId()); |
555 | 555 |
556 // Removes window 3 as candidate for next activatable window. | 556 // Removes window 3 as candidate for next activatable window. |
557 root_window()->GetChildById(3)->Hide(); | 557 root_window()->GetChildById(3)->Hide(); |
558 EXPECT_EQ(1, GetFocusedWindowId()); | 558 EXPECT_EQ(1, GetFocusedWindowId()); |
559 | 559 |
560 aura::Window* target = root_window()->GetChildById(2); | 560 aura::Window* target = root_window()->GetChildById(2); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 // activation change observer are ignored. | 991 // activation change observer are ignored. |
992 DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivation); | 992 DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivation); |
993 DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivationDueToHide); | 993 DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivationDueToHide); |
994 DIRECT_FOCUS_CHANGE_TESTS(NoShiftActiveOnActivation); | 994 DIRECT_FOCUS_CHANGE_TESTS(NoShiftActiveOnActivation); |
995 | 995 |
996 // Clicking on a window which has capture should not result in a focus change. | 996 // Clicking on a window which has capture should not result in a focus change. |
997 DIRECT_FOCUS_CHANGE_TESTS(NoFocusChangeOnClickOnCaptureWindow); | 997 DIRECT_FOCUS_CHANGE_TESTS(NoFocusChangeOnClickOnCaptureWindow); |
998 | 998 |
999 } // namespace corewm | 999 } // namespace corewm |
1000 } // namespace views | 1000 } // namespace views |
OLD | NEW |