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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10982040: Fix mouse lock on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/aura/shared/compound_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 NativeWebKeyboardEvent webkit_event(event); 1457 NativeWebKeyboardEvent webkit_event(event);
1458 host_->ForwardKeyboardEvent(webkit_event); 1458 host_->ForwardKeyboardEvent(webkit_event);
1459 } 1459 }
1460 } 1460 }
1461 return ui::ER_HANDLED; 1461 return ui::ER_HANDLED;
1462 } 1462 }
1463 1463
1464 ui::EventResult RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { 1464 ui::EventResult RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
1465 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent"); 1465 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent");
1466 if (mouse_locked_) { 1466 if (mouse_locked_) {
1467 // Hide the cursor if someone else has shown it.
1468 aura::client::CursorClient* cursor_client =
1469 aura::client::GetCursorClient(window_->GetRootWindow());
1470 if (cursor_client && cursor_client->IsCursorVisible())
1471 cursor_client->ShowCursor(false);
1472
1467 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); 1473 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
1468 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); 1474 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint());
1469 1475
1470 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || 1476 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED ||
1471 event->type() == ui::ET_MOUSE_DRAGGED) && 1477 event->type() == ui::ET_MOUSE_DRAGGED) &&
1472 mouse_event.x == center.x() && mouse_event.y == center.y(); 1478 mouse_event.x == center.x() && mouse_event.y == center.y();
1473 1479
1474 ModifyEventMovementAndCoords(&mouse_event); 1480 ModifyEventMovementAndCoords(&mouse_event);
1475 1481
1476 bool should_not_forward = is_move_to_center_event && synthetic_move_sent_; 1482 bool should_not_forward = is_move_to_center_event && synthetic_move_sent_;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 RenderWidgetHost* widget) { 1881 RenderWidgetHost* widget) {
1876 return new RenderWidgetHostViewAura(widget); 1882 return new RenderWidgetHostViewAura(widget);
1877 } 1883 }
1878 1884
1879 // static 1885 // static
1880 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1886 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1881 GetScreenInfoForWindow(results, NULL); 1887 GetScreenInfoForWindow(results, NULL);
1882 } 1888 }
1883 1889
1884 } // namespace content 1890 } // namespace content
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/aura/shared/compound_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698