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

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

Issue 16505003: Fix mouse wheel events in pointer lock on aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | 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 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent"); 2324 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent");
2325 2325
2326 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) 2326 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event))
2327 return; 2327 return;
2328 2328
2329 if (mouse_locked_) { 2329 if (mouse_locked_) {
2330 aura::client::CursorClient* cursor_client = 2330 aura::client::CursorClient* cursor_client =
2331 aura::client::GetCursorClient(window_->GetRootWindow()); 2331 aura::client::GetCursorClient(window_->GetRootWindow());
2332 DCHECK(!cursor_client || !cursor_client->IsCursorVisible()); 2332 DCHECK(!cursor_client || !cursor_client->IsCursorVisible());
2333 2333
2334 if (event->type() == ui::ET_MOUSEWHEEL) {
ananta 2013/06/05 23:16:14 We should be handling this similarly for mouse whe
scheib 2013/06/06 02:42:37 True. That code already exists below, outside of t
2335 WebKit::WebMouseWheelEvent mouse_wheel_event =
2336 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event));
2337 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0)
2338 host_->ForwardWheelEvent(mouse_wheel_event);
2339 return;
2340 }
2341
2334 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); 2342 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
2335 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); 2343 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint());
2336 2344
2337 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || 2345 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED ||
2338 event->type() == ui::ET_MOUSE_DRAGGED) && 2346 event->type() == ui::ET_MOUSE_DRAGGED) &&
2339 mouse_event.x == center.x() && mouse_event.y == center.y(); 2347 mouse_event.x == center.x() && mouse_event.y == center.y();
2340 2348
2341 ModifyEventMovementAndCoords(&mouse_event); 2349 ModifyEventMovementAndCoords(&mouse_event);
2342 2350
2343 bool should_not_forward = is_move_to_center_event && synthetic_move_sent_; 2351 bool should_not_forward = is_move_to_center_event && synthetic_move_sent_;
(...skipping 22 matching lines...) Expand all
2366 if (host_->overscroll_controller() && 2374 if (host_->overscroll_controller() &&
2367 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE && 2375 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE &&
2368 event->flags() & ui::EF_IS_SYNTHESIZED && 2376 event->flags() & ui::EF_IS_SYNTHESIZED &&
2369 (event->type() == ui::ET_MOUSE_ENTERED || 2377 (event->type() == ui::ET_MOUSE_ENTERED ||
2370 event->type() == ui::ET_MOUSE_EXITED || 2378 event->type() == ui::ET_MOUSE_EXITED ||
2371 event->type() == ui::ET_MOUSE_MOVED)) { 2379 event->type() == ui::ET_MOUSE_MOVED)) {
2372 event->StopPropagation(); 2380 event->StopPropagation();
2373 return; 2381 return;
2374 } 2382 }
2375 2383
2376 if (event->type() == ui::ET_MOUSEWHEEL) { 2384 if (event->type() == ui::ET_MOUSEWHEEL) {
scheib 2013/06/06 02:42:37 Here.
2377 #if defined(OS_WIN) 2385 #if defined(OS_WIN)
2378 // We get mouse wheel/scroll messages even if we are not in the foreground. 2386 // We get mouse wheel/scroll messages even if we are not in the foreground.
2379 // So here we check if we have any owned popup windows in the foreground and 2387 // So here we check if we have any owned popup windows in the foreground and
2380 // dismiss them. 2388 // dismiss them.
2381 aura::RootWindow* root_window = window_->GetRootWindow(); 2389 aura::RootWindow* root_window = window_->GetRootWindow();
2382 if (root_window) { 2390 if (root_window) {
2383 HWND parent = root_window->GetAcceleratedWidget(); 2391 HWND parent = root_window->GetAcceleratedWidget();
2384 HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT); 2392 HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT);
2385 EnumThreadWindows(GetCurrentThreadId(), 2393 EnumThreadWindows(GetCurrentThreadId(),
2386 DismissOwnedPopups, 2394 DismissOwnedPopups,
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
2991 RenderWidgetHost* widget) { 2999 RenderWidgetHost* widget) {
2992 return new RenderWidgetHostViewAura(widget); 3000 return new RenderWidgetHostViewAura(widget);
2993 } 3001 }
2994 3002
2995 // static 3003 // static
2996 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3004 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
2997 GetScreenInfoForWindow(results, NULL); 3005 GetScreenInfoForWindow(results, NULL);
2998 } 3006 }
2999 3007
3000 } // namespace content 3008 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698