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 "ash/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 #include "ash/accelerators/accelerator_table.h" | 6 #include "ash/accelerators/accelerator_table.h" |
7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/caps_lock_delegate.h" | 9 #include "ash/caps_lock_delegate.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 #endif | 629 #endif |
630 | 630 |
631 #if defined(OS_WIN) || defined(USE_X11) | 631 #if defined(OS_WIN) || defined(USE_X11) |
632 TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) { | 632 TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) { |
633 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); | 633 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); |
634 TestTarget target; | 634 TestTarget target; |
635 GetController()->Register(accelerator_a, &target); | 635 GetController()->Register(accelerator_a, &target); |
636 | 636 |
637 // The accelerator is processed only once. | 637 // The accelerator is processed only once. |
638 aura::WindowEventDispatcher* dispatcher = | 638 aura::WindowEventDispatcher* dispatcher = |
639 Shell::GetPrimaryRootWindow()->GetDispatcher(); | 639 Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); |
640 #if defined(OS_WIN) | 640 #if defined(OS_WIN) |
641 MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 }; | 641 MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 }; |
642 ui::TranslatedKeyEvent key_event1(msg1, false); | 642 ui::TranslatedKeyEvent key_event1(msg1, false); |
643 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&key_event1); | 643 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&key_event1); |
644 EXPECT_TRUE(key_event1.handled() || details.dispatcher_destroyed); | 644 EXPECT_TRUE(key_event1.handled() || details.dispatcher_destroyed); |
645 | 645 |
646 MSG msg2 = { NULL, WM_CHAR, L'A', 0 }; | 646 MSG msg2 = { NULL, WM_CHAR, L'A', 0 }; |
647 ui::TranslatedKeyEvent key_event2(msg2, true); | 647 ui::TranslatedKeyEvent key_event2(msg2, true); |
648 details = dispatcher->OnEventFromSource(&key_event2); | 648 details = dispatcher->OnEventFromSource(&key_event2); |
649 EXPECT_FALSE(key_event2.handled() || details.dispatcher_destroyed); | 649 EXPECT_FALSE(key_event2.handled() || details.dispatcher_destroyed); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 // Don't alert if we have a minimized window either. | 1369 // Don't alert if we have a minimized window either. |
1370 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 1370 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
1371 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { | 1371 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { |
1372 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); | 1372 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); |
1373 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); | 1373 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); |
1374 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); | 1374 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); |
1375 } | 1375 } |
1376 } | 1376 } |
1377 | 1377 |
1378 } // namespace ash | 1378 } // namespace ash |
OLD | NEW |