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

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

Issue 11411059: overscroll-aura: Discard synthetic mouse-move events during a trackpad overscroll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "content/browser/renderer_host/backing_store_aura.h" 14 #include "content/browser/renderer_host/backing_store_aura.h"
15 #include "content/browser/renderer_host/dip_util.h" 15 #include "content/browser/renderer_host/dip_util.h"
16 #include "content/browser/renderer_host/overscroll_controller.h"
16 #include "content/browser/renderer_host/render_view_host_delegate.h" 17 #include "content/browser/renderer_host/render_view_host_delegate.h"
17 #include "content/browser/renderer_host/render_widget_host_impl.h" 18 #include "content/browser/renderer_host/render_widget_host_impl.h"
18 #include "content/browser/renderer_host/ui_events_helper.h" 19 #include "content/browser/renderer_host/ui_events_helper.h"
19 #include "content/browser/renderer_host/web_input_event_aura.h" 20 #include "content/browser/renderer_host/web_input_event_aura.h"
20 #include "content/common/gpu/client/gl_helper.h" 21 #include "content/common/gpu/client/gl_helper.h"
21 #include "content/common/gpu/gpu_messages.h" 22 #include "content/common/gpu/gpu_messages.h"
22 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
23 #include "content/port/browser/render_widget_host_view_port.h" 24 #include "content/port/browser/render_widget_host_view_port.h"
24 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
25 #include "content/public/browser/render_view_host.h" 26 #include "content/public/browser/render_view_host.h"
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 } 1563 }
1563 1564
1564 // Forward event to renderer. 1565 // Forward event to renderer.
1565 if (CanRendererHandleEvent(event)) 1566 if (CanRendererHandleEvent(event))
1566 host_->ForwardMouseEvent(mouse_event); 1567 host_->ForwardMouseEvent(mouse_event);
1567 } 1568 }
1568 1569
1569 return ui::ER_UNHANDLED; 1570 return ui::ER_UNHANDLED;
1570 } 1571 }
1571 1572
1573 // As the overscroll is handled during scroll events from the trackpad, the
1574 // RWHVA window is transformed by the overscroll controller. This transform
1575 // triggers a synthetic mouse-move event to be generated (by the aura
1576 // RootWindow). But this event interferes with the overscroll gesture. So,
1577 // ignore such synthetic mouse-move events if an overscroll gesture is in
1578 // progress.
1579 if (host_->overscroll_controller() &&
1580 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE &&
1581 event->flags() & ui::EF_IS_SYNTHESIZED &&
1582 (event->type() == ui::ET_MOUSE_ENTERED ||
1583 event->type() == ui::ET_MOUSE_MOVED)) {
1584 return ui::ER_CONSUMED;
1585 }
1586
1572 if (event->type() == ui::ET_MOUSEWHEEL) { 1587 if (event->type() == ui::ET_MOUSEWHEEL) {
1573 WebKit::WebMouseWheelEvent mouse_wheel_event = 1588 WebKit::WebMouseWheelEvent mouse_wheel_event =
1574 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); 1589 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event));
1575 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) 1590 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0)
1576 host_->ForwardWheelEvent(mouse_wheel_event); 1591 host_->ForwardWheelEvent(mouse_wheel_event);
1577 } else if (CanRendererHandleEvent(event)) { 1592 } else if (CanRendererHandleEvent(event)) {
1578 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); 1593 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
1579 ModifyEventMovementAndCoords(&mouse_event); 1594 ModifyEventMovementAndCoords(&mouse_event);
1580 host_->ForwardMouseEvent(mouse_event); 1595 host_->ForwardMouseEvent(mouse_event);
1581 } 1596 }
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 RenderWidgetHost* widget) { 1994 RenderWidgetHost* widget) {
1980 return new RenderWidgetHostViewAura(widget); 1995 return new RenderWidgetHostViewAura(widget);
1981 } 1996 }
1982 1997
1983 // static 1998 // static
1984 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1999 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1985 GetScreenInfoForWindow(results, NULL); 2000 GetScreenInfoForWindow(results, NULL);
1986 } 2001 }
1987 2002
1988 } // namespace content 2003 } // 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