Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: ui/aura/root_window.cc

Issue 11956019: Merge 173933 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/root_window_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
===================================================================
--- ui/aura/root_window.cc (revision 177177)
+++ ui/aura/root_window.cc (working copy)
@@ -68,9 +68,17 @@
static_cast<Window*>(consumer) : NULL;
}
-void SetLastMouseLocation(const Window* root_window,
- const gfx::Point& location) {
- Env::GetInstance()->SetLastMouseLocation(*root_window, location);
+void SetLastMouseLocation(const RootWindow* root_window,
+ const gfx::Point& location_in_root) {
+ client::ScreenPositionClient* client =
+ client::GetScreenPositionClient(root_window);
+ if (client) {
+ gfx::Point location_in_screen = location_in_root;
+ client->ConvertPointToScreen(root_window, &location_in_screen);
+ Env::GetInstance()->set_last_mouse_location(location_in_screen);
+ } else {
+ Env::GetInstance()->set_last_mouse_location(location_in_root);
+ }
}
RootWindowHost* CreateHost(RootWindow* root_window,
@@ -206,11 +214,14 @@
}
void RootWindow::OnCursorVisibilityChanged(bool show) {
+ host_->OnCursorVisibilityChanged(show);
+}
+
+void RootWindow::OnMouseEventsEnableStateChanged(bool enabled) {
// Send entered / exited so that visual state can be updated to match
- // cursor state.
- Env::GetInstance()->SetCursorShown(show);
+ // mouse events state.
PostMouseMoveEventAfterWindowChange();
- host_->OnCursorVisibilityChanged(show);
+ // TODO(mazda): Add code to disable mouse events when |enabled| == false.
}
void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) {
@@ -498,7 +509,7 @@
if (cursor_is_in_bounds && cursor_client) {
cursor_visible = cursor_client->IsCursorVisible();
if (cursor_visible)
- cursor_client->ShowCursor(false);
+ cursor_client->HideCursor();
}
host_->OnDeviceScaleFactorChanged(device_scale_factor);
Window::OnDeviceScaleFactorChanged(device_scale_factor);
@@ -509,7 +520,7 @@
cursor_client->SetDeviceScaleFactor(device_scale_factor);
}
if (cursor_is_in_bounds && cursor_client && cursor_visible)
- cursor_client->ShowCursor(true);
+ cursor_client->ShowCursor();
}
////////////////////////////////////////////////////////////////////////////////
@@ -568,10 +579,8 @@
host_->ReleaseCapture();
}
-gfx::Point RootWindow::QueryMouseLocationForTest() const {
- gfx::Point point;
- host_->QueryMouseLocation(&point);
- return point;
+bool RootWindow::QueryMouseLocationForTest(gfx::Point* point) const {
+ return host_->QueryMouseLocation(point);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/root_window_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698