summaryrefslogtreecommitdiffstats
path: root/ash/accelerators
diff options
context:
space:
mode:
Diffstat (limited to 'ash/accelerators')
-rw-r--r--ash/accelerators/accelerator_controller.cc2
-rw-r--r--ash/accelerators/accelerator_controller_unittest.cc26
-rw-r--r--ash/accelerators/exit_warning_handler.cc4
-rw-r--r--ash/accelerators/nested_dispatcher_controller_unittest.cc14
4 files changed, 25 insertions, 21 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 4cc30ed..052baaa 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -284,7 +284,7 @@ bool HandleRotateScreen() {
}
bool HandleToggleRootWindowFullScreen() {
- Shell::GetPrimaryRootWindow()->ToggleFullScreen();
+ Shell::GetPrimaryRootWindow()->GetDispatcher()->ToggleFullScreen();
return true;
}
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index ce62062..575a5ec 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -603,21 +603,23 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
GetController()->Register(accelerator_a, &target);
// The accelerator is processed only once.
+ aura::WindowEventDispatcher* dispatcher =
+ Shell::GetPrimaryRootWindow()->GetDispatcher();
#if defined(OS_WIN)
MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event1(msg1, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
MSG msg2 = { NULL, WM_CHAR, L'A', 0 };
ui::TranslatedKeyEvent key_event2(msg2, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
MSG msg3 = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event3(msg3, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#elif defined(USE_X11)
XEvent key_event;
ui::InitXKeyEventForTesting(ui::ET_KEY_PRESSED,
@@ -625,20 +627,20 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
0,
&key_event);
ui::TranslatedKeyEvent key_event1(&key_event, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
ui::TranslatedKeyEvent key_event2(&key_event, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&key_event);
ui::TranslatedKeyEvent key_event3(&key_event, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#endif
EXPECT_EQ(1, target.accelerator_pressed_count());
}
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc
index 6ea635a..1f8b53e 100644
--- a/ash/accelerators/exit_warning_handler.cc
+++ b/ash/accelerators/exit_warning_handler.cc
@@ -11,7 +11,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "grit/ash_strings.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -165,7 +165,7 @@ void ExitWarningHandler::CancelTimer() {
void ExitWarningHandler::Show() {
if (widget_)
return;
- aura::RootWindow* root_window = Shell::GetTargetRootWindow();
+ aura::Window* root_window = Shell::GetTargetRootWindow();
ExitWarningWidgetDelegateView* delegate = new ExitWarningWidgetDelegateView;
gfx::Size rs = root_window->bounds().size();
gfx::Size ps = delegate->GetPreferredSize();
diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc
index 955630c..232ae9c 100644
--- a/ash/accelerators/nested_dispatcher_controller_unittest.cc
+++ b/ash/accelerators/nested_dispatcher_controller_unittest.cc
@@ -88,16 +88,18 @@ void DispatchKeyReleaseA() {
ui::VKEY_A,
0,
&native_event);
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(&native_event);
+ aura::WindowEventDispatcher* dispatcher =
+ ash::Shell::GetPrimaryRootWindow()->GetDispatcher();
+ dispatcher->PostNativeEvent(&native_event);
ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&native_event);
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(&native_event);
+ dispatcher->PostNativeEvent(&native_event);
#endif
// Send noop event to signal dispatcher to exit.
- ash::Shell::GetPrimaryRootWindow()->PostNativeEvent(ui::CreateNoopEvent());
+ dispatcher->PostNativeEvent(ui::CreateNoopEvent());
}
} // namespace
@@ -111,7 +113,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) {
Shell::GetInstance()->session_state_delegate()->LockScreen();
DispatchKeyReleaseA();
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
aura::client::GetDispatcherClient(root_window)->RunWithDispatcher(
&inner_dispatcher,
associated_window.get(),
@@ -132,7 +134,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) {
mock_lock_container.get()));
DispatchKeyReleaseA();
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
aura::client::GetDispatcherClient(root_window)->RunWithDispatcher(
&inner_dispatcher,
associated_window.get(),
@@ -143,7 +145,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) {
// Test that the nested dispatcher handles accelerators.
TEST_F(NestedDispatcherTest, AcceleratorsHandled) {
MockDispatcher inner_dispatcher;
- aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
ui::Accelerator accelerator(ui::VKEY_A, ui::EF_NONE);
accelerator.set_type(ui::ET_KEY_RELEASED);