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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index daf80cbdeceb6015c871c26b37ddaedf1161827e..8e20a5bf364775df59ba3093eb0a47ac202bec53 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2270,6 +2270,12 @@ bool RenderWidgetHostViewAura::LockMouse() {
mouse_locked_ = true;
#if !defined(OS_WIN)
window_->SetCapture();
+#else
+ if (gfx::Screen::GetScreenFor(window_) ==
+ gfx::Screen::GetNativeScreen()) {
+ RECT window_rect = window_->GetBoundsInScreen().ToRECT();
+ ::ClipCursor(&window_rect);
+ }
#endif
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(root_window);
@@ -2283,8 +2289,6 @@ bool RenderWidgetHostViewAura::LockMouse() {
window_->MoveCursorTo(gfx::Rect(window_->bounds().size()).CenterPoint());
}
tooltip_disabler_.reset(new aura::client::ScopedTooltipDisabler(root_window));
-
- root_window->GetHost()->ConfineCursorToRootWindow();
oshima 2014/03/26 00:56:03 This was added in https://codereview.chromium.org/
Ben Goodger (Google) 2014/03/26 05:11:08 Maybe peel this out as a separate CL?
return true;
}
@@ -2299,6 +2303,8 @@ void RenderWidgetHostViewAura::UnlockMouse() {
#if !defined(OS_WIN)
window_->ReleaseCapture();
+#else
+ ::ClipCursor(NULL);
#endif
window_->MoveCursorTo(unlocked_mouse_position_);
aura::client::CursorClient* cursor_client =
@@ -2309,7 +2315,6 @@ void RenderWidgetHostViewAura::UnlockMouse() {
}
host_->LostMouseLock();
- root_window->GetHost()->UnConfineCursor();
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698