summaryrefslogtreecommitdiffstats
path: root/ash/autoclick
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
commitbf9cdb36cc79becab099c9f37eb80284fb203f45 (patch)
tree4c9011f0aa08ac613027abd372cec3a3b613032b /ash/autoclick
parentfef72c1c9890633a237e06ccb0d0f4ce2ca6c9c1 (diff)
downloadchromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.zip
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.gz
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.bz2
Make GetRootWindow() return a Window instead of a RootWindow.
Also adds a typedef from RootWindow to WindowEventDispatcher, the eventual name of this type. Adds a GetDispatcher() method that crawls up to the root Window and returns the WindowEventDispatcher. R=sky@chromium.org http://crbug.com/308843 Review URL: https://codereview.chromium.org/37733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/autoclick')
-rw-r--r--ash/autoclick/autoclick_controller.cc10
-rw-r--r--ash/autoclick/autoclick_unittest.cc1
2 files changed, 7 insertions, 4 deletions
diff --git a/ash/autoclick/autoclick_controller.cc b/ash/autoclick/autoclick_controller.cc
index 31dfe3f..17b2558 100644
--- a/ash/autoclick/autoclick_controller.cc
+++ b/ash/autoclick/autoclick_controller.cc
@@ -154,13 +154,15 @@ void AutoclickControllerImpl::OnTouchEvent(ui::TouchEvent* event) {
void AutoclickControllerImpl::DoAutoclick() {
gfx::Point screen_location =
aura::Env::GetInstance()->last_mouse_location();
- aura::RootWindow* root_window = wm::GetRootWindowAt(screen_location);
+ aura::Window* root_window = wm::GetRootWindowAt(screen_location);
DCHECK(root_window) << "Root window not found while attempting autoclick.";
gfx::Point click_location(screen_location);
anchor_location_ = click_location;
wm::ConvertPointFromScreen(root_window, &click_location);
- root_window->ConvertPointToHost(&click_location);
+
+ aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
+ dispatcher->ConvertPointToHost(&click_location);
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED,
click_location,
@@ -171,8 +173,8 @@ void AutoclickControllerImpl::DoAutoclick() {
click_location,
mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
- root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
+ dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
}
// static.
diff --git a/ash/autoclick/autoclick_unittest.cc b/ash/autoclick/autoclick_unittest.cc
index e9fd5cc..7369511 100644
--- a/ash/autoclick/autoclick_unittest.cc
+++ b/ash/autoclick/autoclick_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/autoclick/autoclick_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"