| OLD | NEW |
| 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 <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 28 #include "content/browser/bad_message.h" | 28 #include "content/browser/bad_message.h" |
| 29 #include "content/browser/frame_host/frame_tree.h" | 29 #include "content/browser/frame_host/frame_tree.h" |
| 30 #include "content/browser/frame_host/frame_tree_node.h" | 30 #include "content/browser/frame_host/frame_tree_node.h" |
| 31 #include "content/browser/frame_host/render_frame_host_impl.h" | 31 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 32 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
| 33 #include "content/browser/renderer_host/compositor_resize_lock_aura.h" | 33 #include "content/browser/renderer_host/compositor_resize_lock_aura.h" |
| 34 #include "content/browser/renderer_host/dip_util.h" | 34 #include "content/browser/renderer_host/dip_util.h" |
| 35 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" | 35 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" |
| 36 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 36 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 37 #include "content/browser/renderer_host/input/web_input_event_util.h" | |
| 38 #include "content/browser/renderer_host/overscroll_controller.h" | 37 #include "content/browser/renderer_host/overscroll_controller.h" |
| 39 #include "content/browser/renderer_host/render_view_host_delegate.h" | 38 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 39 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 41 #include "content/browser/renderer_host/render_view_host_impl.h" | 40 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 42 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 41 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 43 #include "content/browser/renderer_host/render_widget_host_impl.h" | 42 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 44 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 43 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 45 #include "content/browser/renderer_host/ui_events_helper.h" | 44 #include "content/browser/renderer_host/ui_events_helper.h" |
| 46 #include "content/browser/renderer_host/web_input_event_aura.h" | |
| 47 #include "content/common/content_switches_internal.h" | 45 #include "content/common/content_switches_internal.h" |
| 48 #include "content/common/input_messages.h" | 46 #include "content/common/input_messages.h" |
| 49 #include "content/common/site_isolation_policy.h" | 47 #include "content/common/site_isolation_policy.h" |
| 50 #include "content/common/text_input_state.h" | 48 #include "content/common/text_input_state.h" |
| 51 #include "content/common/view_messages.h" | 49 #include "content/common/view_messages.h" |
| 52 #include "content/public/browser/content_browser_client.h" | 50 #include "content/public/browser/content_browser_client.h" |
| 53 #include "content/public/browser/overscroll_configuration.h" | 51 #include "content/public/browser/overscroll_configuration.h" |
| 54 #include "content/public/browser/render_view_host.h" | 52 #include "content/public/browser/render_view_host.h" |
| 55 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 53 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
| 56 #include "content/public/browser/user_metrics.h" | 54 #include "content/public/browser/user_metrics.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 73 #include "ui/aura/window_tree_host.h" | 71 #include "ui/aura/window_tree_host.h" |
| 74 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 72 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 75 #include "ui/base/hit_test.h" | 73 #include "ui/base/hit_test.h" |
| 76 #include "ui/base/ime/input_method.h" | 74 #include "ui/base/ime/input_method.h" |
| 77 #include "ui/base/ui_base_types.h" | 75 #include "ui/base/ui_base_types.h" |
| 78 #include "ui/compositor/compositor_vsync_manager.h" | 76 #include "ui/compositor/compositor_vsync_manager.h" |
| 79 #include "ui/compositor/dip_util.h" | 77 #include "ui/compositor/dip_util.h" |
| 80 #include "ui/display/display.h" | 78 #include "ui/display/display.h" |
| 81 #include "ui/display/screen.h" | 79 #include "ui/display/screen.h" |
| 82 #include "ui/events/blink/blink_event_util.h" | 80 #include "ui/events/blink/blink_event_util.h" |
| 81 #include "ui/events/blink/web_input_event.h" |
| 83 #include "ui/events/event.h" | 82 #include "ui/events/event.h" |
| 84 #include "ui/events/event_utils.h" | 83 #include "ui/events/event_utils.h" |
| 85 #include "ui/events/gesture_detection/gesture_configuration.h" | 84 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 86 #include "ui/events/gestures/gesture_recognizer.h" | 85 #include "ui/events/gestures/gesture_recognizer.h" |
| 87 #include "ui/gfx/canvas.h" | 86 #include "ui/gfx/canvas.h" |
| 88 #include "ui/gfx/geometry/dip_util.h" | 87 #include "ui/gfx/geometry/dip_util.h" |
| 89 #include "ui/gfx/geometry/rect_conversions.h" | 88 #include "ui/gfx/geometry/rect_conversions.h" |
| 90 #include "ui/gfx/geometry/size_conversions.h" | 89 #include "ui/gfx/geometry/size_conversions.h" |
| 91 #include "ui/gfx/skia_util.h" | 90 #include "ui/gfx/skia_util.h" |
| 92 #include "ui/touch_selection/touch_selection_controller.h" | 91 #include "ui/touch_selection/touch_selection_controller.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 int changed_touch_id) { | 206 int changed_touch_id) { |
| 208 if (event->type == blink::WebInputEvent::TouchMove || | 207 if (event->type == blink::WebInputEvent::TouchMove || |
| 209 event->type == blink::WebInputEvent::TouchCancel) { | 208 event->type == blink::WebInputEvent::TouchCancel) { |
| 210 for (size_t i = 0; i < event->touchesLength; ++i) { | 209 for (size_t i = 0; i < event->touchesLength; ++i) { |
| 211 if (event->touches[i].id != changed_touch_id) | 210 if (event->touches[i].id != changed_touch_id) |
| 212 event->touches[i].state = blink::WebTouchPoint::StateStationary; | 211 event->touches[i].state = blink::WebTouchPoint::StateStationary; |
| 213 } | 212 } |
| 214 } | 213 } |
| 215 } | 214 } |
| 216 | 215 |
| 216 gfx::Point GetScreenLocationFromEvent(const ui::LocatedEvent& event) { |
| 217 aura::Window* root = |
| 218 static_cast<aura::Window*>(event.target())->GetRootWindow(); |
| 219 aura::client::ScreenPositionClient* spc = |
| 220 aura::client::GetScreenPositionClient(root); |
| 221 if (!spc) |
| 222 return event.root_location(); |
| 223 |
| 224 gfx::Point screen_location(event.root_location()); |
| 225 spc->ConvertPointToScreen(root, &screen_location); |
| 226 return screen_location; |
| 227 } |
| 228 |
| 217 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
| 218 // This class implements the ui::OnScreenKeyboardObserver interface | 230 // This class implements the ui::OnScreenKeyboardObserver interface |
| 219 // which provides notifications about the on screen keyboard on Windows getting | 231 // which provides notifications about the on screen keyboard on Windows getting |
| 220 // displayed or hidden in response to taps on editable fields. | 232 // displayed or hidden in response to taps on editable fields. |
| 221 // It provides functionality to request blink to scroll the input field if it | 233 // It provides functionality to request blink to scroll the input field if it |
| 222 // is obscured by the on screen keyboard. | 234 // is obscured by the on screen keyboard. |
| 223 class WinScreenKeyboardObserver : public ui::OnScreenKeyboardObserver { | 235 class WinScreenKeyboardObserver : public ui::OnScreenKeyboardObserver { |
| 224 public: | 236 public: |
| 225 WinScreenKeyboardObserver(RenderWidgetHostImpl* host, | 237 WinScreenKeyboardObserver(RenderWidgetHostImpl* host, |
| 226 const gfx::Point& location_in_screen, | 238 const gfx::Point& location_in_screen, |
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 // breaks drop-down lists which means something is incorrectly setting | 1863 // breaks drop-down lists which means something is incorrectly setting |
| 1852 // event->handled to true (http://crbug.com/577983). | 1864 // event->handled to true (http://crbug.com/577983). |
| 1853 | 1865 |
| 1854 if (mouse_locked_) { | 1866 if (mouse_locked_) { |
| 1855 aura::client::CursorClient* cursor_client = | 1867 aura::client::CursorClient* cursor_client = |
| 1856 aura::client::GetCursorClient(window_->GetRootWindow()); | 1868 aura::client::GetCursorClient(window_->GetRootWindow()); |
| 1857 DCHECK(!cursor_client || !cursor_client->IsCursorVisible()); | 1869 DCHECK(!cursor_client || !cursor_client->IsCursorVisible()); |
| 1858 | 1870 |
| 1859 if (event->type() == ui::ET_MOUSEWHEEL) { | 1871 if (event->type() == ui::ET_MOUSEWHEEL) { |
| 1860 blink::WebMouseWheelEvent mouse_wheel_event = | 1872 blink::WebMouseWheelEvent mouse_wheel_event = |
| 1861 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent&>(*event)); | 1873 ui::MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent&>(*event), |
| 1874 base::Bind(&GetScreenLocationFromEvent)); |
| 1862 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) | 1875 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) |
| 1863 host_->ForwardWheelEvent(mouse_wheel_event); | 1876 host_->ForwardWheelEvent(mouse_wheel_event); |
| 1864 return; | 1877 return; |
| 1865 } | 1878 } |
| 1866 | 1879 |
| 1867 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); | 1880 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); |
| 1868 | 1881 |
| 1869 // If we receive non client mouse messages while we are in the locked state | 1882 // If we receive non client mouse messages while we are in the locked state |
| 1870 // it probably means that the mouse left the borders of our window and | 1883 // it probably means that the mouse left the borders of our window and |
| 1871 // needs to be moved back to the center. | 1884 // needs to be moved back to the center. |
| 1872 if (event->flags() & ui::EF_IS_NON_CLIENT) { | 1885 if (event->flags() & ui::EF_IS_NON_CLIENT) { |
| 1873 synthetic_move_sent_ = true; | 1886 synthetic_move_sent_ = true; |
| 1874 window_->MoveCursorTo(center); | 1887 window_->MoveCursorTo(center); |
| 1875 return; | 1888 return; |
| 1876 } | 1889 } |
| 1877 | 1890 |
| 1878 blink::WebMouseEvent mouse_event = MakeWebMouseEvent(*event); | 1891 blink::WebMouseEvent mouse_event = |
| 1892 ui::MakeWebMouseEvent(*event, base::Bind(&GetScreenLocationFromEvent)); |
| 1879 | 1893 |
| 1880 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || | 1894 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || |
| 1881 event->type() == ui::ET_MOUSE_DRAGGED) && | 1895 event->type() == ui::ET_MOUSE_DRAGGED) && |
| 1882 mouse_event.x == center.x() && mouse_event.y == center.y(); | 1896 mouse_event.x == center.x() && mouse_event.y == center.y(); |
| 1883 | 1897 |
| 1884 // For fractional scale factors, the conversion from pixels to dip and | 1898 // For fractional scale factors, the conversion from pixels to dip and |
| 1885 // vice versa could result in off by 1 or 2 errors which hurts us because | 1899 // vice versa could result in off by 1 or 2 errors which hurts us because |
| 1886 // we want to avoid sending the artificial move to center event to the | 1900 // we want to avoid sending the artificial move to center event to the |
| 1887 // renderer. Sending the move to center to the renderer cause the cursor | 1901 // renderer. Sending the move to center to the renderer cause the cursor |
| 1888 // to bounce around the center of the screen leading to the lock operation | 1902 // to bounce around the center of the screen leading to the lock operation |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 aura::WindowTreeHost* host = window_->GetHost(); | 1964 aura::WindowTreeHost* host = window_->GetHost(); |
| 1951 if (host) { | 1965 if (host) { |
| 1952 HWND parent = host->GetAcceleratedWidget(); | 1966 HWND parent = host->GetAcceleratedWidget(); |
| 1953 HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT); | 1967 HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT); |
| 1954 EnumThreadWindows(GetCurrentThreadId(), | 1968 EnumThreadWindows(GetCurrentThreadId(), |
| 1955 DismissOwnedPopups, | 1969 DismissOwnedPopups, |
| 1956 reinterpret_cast<LPARAM>(toplevel_hwnd)); | 1970 reinterpret_cast<LPARAM>(toplevel_hwnd)); |
| 1957 } | 1971 } |
| 1958 #endif | 1972 #endif |
| 1959 blink::WebMouseWheelEvent mouse_wheel_event = | 1973 blink::WebMouseWheelEvent mouse_wheel_event = |
| 1960 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent&>(*event)); | 1974 ui::MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent&>(*event), |
| 1975 base::Bind(&GetScreenLocationFromEvent)); |
| 1961 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) { | 1976 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) { |
| 1962 if (ShouldRouteEvent(event)) { | 1977 if (ShouldRouteEvent(event)) { |
| 1963 host_->delegate()->GetInputEventRouter()->RouteMouseWheelEvent( | 1978 host_->delegate()->GetInputEventRouter()->RouteMouseWheelEvent( |
| 1964 this, &mouse_wheel_event); | 1979 this, &mouse_wheel_event); |
| 1965 } else { | 1980 } else { |
| 1966 ProcessMouseWheelEvent(mouse_wheel_event, *event->latency()); | 1981 ProcessMouseWheelEvent(mouse_wheel_event, *event->latency()); |
| 1967 } | 1982 } |
| 1968 } | 1983 } |
| 1969 } else { | 1984 } else { |
| 1970 bool is_selection_popup = | 1985 bool is_selection_popup = |
| 1971 popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab(); | 1986 popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab(); |
| 1972 if (CanRendererHandleEvent(event, mouse_locked_, is_selection_popup) && | 1987 if (CanRendererHandleEvent(event, mouse_locked_, is_selection_popup) && |
| 1973 !(event->flags() & ui::EF_FROM_TOUCH)) { | 1988 !(event->flags() & ui::EF_FROM_TOUCH)) { |
| 1974 // Confirm existing composition text on mouse press, to make sure | 1989 // Confirm existing composition text on mouse press, to make sure |
| 1975 // the input caret won't be moved with an ongoing composition text. | 1990 // the input caret won't be moved with an ongoing composition text. |
| 1976 if (event->type() == ui::ET_MOUSE_PRESSED) | 1991 if (event->type() == ui::ET_MOUSE_PRESSED) |
| 1977 FinishImeCompositionSession(); | 1992 FinishImeCompositionSession(); |
| 1978 | 1993 |
| 1979 blink::WebMouseEvent mouse_event = MakeWebMouseEvent(*event); | 1994 blink::WebMouseEvent mouse_event = ui::MakeWebMouseEvent( |
| 1995 *event, base::Bind(&GetScreenLocationFromEvent)); |
| 1980 ModifyEventMovementAndCoords(&mouse_event); | 1996 ModifyEventMovementAndCoords(&mouse_event); |
| 1981 if (ShouldRouteEvent(event)) { | 1997 if (ShouldRouteEvent(event)) { |
| 1982 host_->delegate()->GetInputEventRouter()->RouteMouseEvent(this, | 1998 host_->delegate()->GetInputEventRouter()->RouteMouseEvent(this, |
| 1983 &mouse_event); | 1999 &mouse_event); |
| 1984 } else { | 2000 } else { |
| 1985 ProcessMouseEvent(mouse_event, *event->latency()); | 2001 ProcessMouseEvent(mouse_event, *event->latency()); |
| 1986 } | 2002 } |
| 1987 | 2003 |
| 1988 // Ensure that we get keyboard focus on mouse down as a plugin window may | 2004 // Ensure that we get keyboard focus on mouse down as a plugin window may |
| 1989 // have grabbed keyboard focus. | 2005 // have grabbed keyboard focus. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { | 2111 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { |
| 2096 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); | 2112 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); |
| 2097 | 2113 |
| 2098 if (event->type() == ui::ET_SCROLL) { | 2114 if (event->type() == ui::ET_SCROLL) { |
| 2099 #if !defined(OS_WIN) | 2115 #if !defined(OS_WIN) |
| 2100 // TODO(ananta) | 2116 // TODO(ananta) |
| 2101 // Investigate if this is true for Windows 8 Metro ASH as well. | 2117 // Investigate if this is true for Windows 8 Metro ASH as well. |
| 2102 if (event->finger_count() != 2) | 2118 if (event->finger_count() != 2) |
| 2103 return; | 2119 return; |
| 2104 #endif | 2120 #endif |
| 2105 blink::WebGestureEvent gesture_event = | 2121 blink::WebGestureEvent gesture_event = ui::MakeWebGestureEventFlingCancel(); |
| 2106 MakeWebGestureEventFlingCancel(); | |
| 2107 // Coordinates need to be transferred to the fling cancel gesture only | 2122 // Coordinates need to be transferred to the fling cancel gesture only |
| 2108 // for Surface-targeting to ensure that it is targeted to the correct | 2123 // for Surface-targeting to ensure that it is targeted to the correct |
| 2109 // RenderWidgetHost. | 2124 // RenderWidgetHost. |
| 2110 gesture_event.x = event->x(); | 2125 gesture_event.x = event->x(); |
| 2111 gesture_event.y = event->y(); | 2126 gesture_event.y = event->y(); |
| 2112 blink::WebMouseWheelEvent mouse_wheel_event = | 2127 blink::WebMouseWheelEvent mouse_wheel_event = ui::MakeWebMouseWheelEvent( |
| 2113 MakeWebMouseWheelEvent(*event); | 2128 *event, base::Bind(&GetScreenLocationFromEvent)); |
| 2114 if (ShouldRouteEvent(event)) { | 2129 if (ShouldRouteEvent(event)) { |
| 2115 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( | 2130 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( |
| 2116 this, &gesture_event, ui::LatencyInfo()); | 2131 this, &gesture_event, ui::LatencyInfo()); |
| 2117 host_->delegate()->GetInputEventRouter()->RouteMouseWheelEvent( | 2132 host_->delegate()->GetInputEventRouter()->RouteMouseWheelEvent( |
| 2118 this, &mouse_wheel_event); | 2133 this, &mouse_wheel_event); |
| 2119 } else { | 2134 } else { |
| 2120 host_->ForwardGestureEvent(gesture_event); | 2135 host_->ForwardGestureEvent(gesture_event); |
| 2121 host_->ForwardWheelEventWithLatencyInfo(mouse_wheel_event, | 2136 host_->ForwardWheelEventWithLatencyInfo(mouse_wheel_event, |
| 2122 *event->latency()); | 2137 *event->latency()); |
| 2123 } | 2138 } |
| 2124 RecordAction(base::UserMetricsAction("TrackpadScroll")); | 2139 RecordAction(base::UserMetricsAction("TrackpadScroll")); |
| 2125 } else if (event->type() == ui::ET_SCROLL_FLING_START || | 2140 } else if (event->type() == ui::ET_SCROLL_FLING_START || |
| 2126 event->type() == ui::ET_SCROLL_FLING_CANCEL) { | 2141 event->type() == ui::ET_SCROLL_FLING_CANCEL) { |
| 2127 blink::WebGestureEvent gesture_event = MakeWebGestureEvent(*event); | 2142 blink::WebGestureEvent gesture_event = ui::MakeWebGestureEvent( |
| 2143 *event, base::Bind(&GetScreenLocationFromEvent)); |
| 2128 if (ShouldRouteEvent(event)) { | 2144 if (ShouldRouteEvent(event)) { |
| 2129 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( | 2145 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( |
| 2130 this, &gesture_event, ui::LatencyInfo()); | 2146 this, &gesture_event, ui::LatencyInfo()); |
| 2131 } else { | 2147 } else { |
| 2132 host_->ForwardGestureEvent(gesture_event); | 2148 host_->ForwardGestureEvent(gesture_event); |
| 2133 } | 2149 } |
| 2134 if (event->type() == ui::ET_SCROLL_FLING_START) | 2150 if (event->type() == ui::ET_SCROLL_FLING_START) |
| 2135 RecordAction(base::UserMetricsAction("TrackpadScrollFling")); | 2151 RecordAction(base::UserMetricsAction("TrackpadScrollFling")); |
| 2136 } | 2152 } |
| 2137 | 2153 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 | 2212 |
| 2197 HandleGestureForTouchSelection(event); | 2213 HandleGestureForTouchSelection(event); |
| 2198 if (event->handled()) | 2214 if (event->handled()) |
| 2199 return; | 2215 return; |
| 2200 | 2216 |
| 2201 // Confirm existing composition text on TAP gesture, to make sure the input | 2217 // Confirm existing composition text on TAP gesture, to make sure the input |
| 2202 // caret won't be moved with an ongoing composition text. | 2218 // caret won't be moved with an ongoing composition text. |
| 2203 if (event->type() == ui::ET_GESTURE_TAP) | 2219 if (event->type() == ui::ET_GESTURE_TAP) |
| 2204 FinishImeCompositionSession(); | 2220 FinishImeCompositionSession(); |
| 2205 | 2221 |
| 2206 blink::WebGestureEvent gesture = MakeWebGestureEvent(*event); | 2222 blink::WebGestureEvent gesture = |
| 2223 ui::MakeWebGestureEvent(*event, base::Bind(&GetScreenLocationFromEvent)); |
| 2207 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { | 2224 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { |
| 2208 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an | 2225 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an |
| 2209 // event to stop any in-progress flings. | 2226 // event to stop any in-progress flings. |
| 2210 blink::WebGestureEvent fling_cancel = gesture; | 2227 blink::WebGestureEvent fling_cancel = gesture; |
| 2211 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; | 2228 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; |
| 2212 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen; | 2229 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen; |
| 2213 if (ShouldRouteEvent(event)) { | 2230 if (ShouldRouteEvent(event)) { |
| 2214 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( | 2231 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( |
| 2215 this, &fling_cancel, ui::LatencyInfo()); | 2232 this, &fling_cancel, ui::LatencyInfo()); |
| 2216 } else { | 2233 } else { |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 | 3107 |
| 3091 //////////////////////////////////////////////////////////////////////////////// | 3108 //////////////////////////////////////////////////////////////////////////////// |
| 3092 // RenderWidgetHostViewBase, public: | 3109 // RenderWidgetHostViewBase, public: |
| 3093 | 3110 |
| 3094 // static | 3111 // static |
| 3095 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 3112 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3096 GetScreenInfoForWindow(results, NULL); | 3113 GetScreenInfoForWindow(results, NULL); |
| 3097 } | 3114 } |
| 3098 | 3115 |
| 3099 } // namespace content | 3116 } // namespace content |
| OLD | NEW |