| 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_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 host_->Send(new ViewMsg_ResolveTapDisambiguation( | 1859 host_->Send(new ViewMsg_ResolveTapDisambiguation( |
| 1860 host_->GetRoutingID(), timestamp_seconds, tap_viewport_offset, | 1860 host_->GetRoutingID(), timestamp_seconds, tap_viewport_offset, |
| 1861 is_long_press)); | 1861 is_long_press)); |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) { | 1864 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) { |
| 1865 if (host_) | 1865 if (host_) |
| 1866 host_->MoveCaret(point); | 1866 host_->MoveCaret(point); |
| 1867 } | 1867 } |
| 1868 | 1868 |
| 1869 void RenderWidgetHostViewAndroid::ShowContextMenuAtTouchHandle( | 1869 void RenderWidgetHostViewAndroid::ShowContextMenuAtPoint( |
| 1870 const gfx::Point& point) { | 1870 const gfx::Point& point, |
| 1871 ui::MenuSourceType source_type) { |
| 1871 if (host_) | 1872 if (host_) |
| 1872 host_->ShowContextMenuAtPoint(point, ui::MENU_SOURCE_TOUCH_HANDLE); | 1873 host_->ShowContextMenuAtPoint(point, source_type); |
| 1873 } | 1874 } |
| 1874 | 1875 |
| 1875 void RenderWidgetHostViewAndroid::DismissTextHandles() { | 1876 void RenderWidgetHostViewAndroid::DismissTextHandles() { |
| 1876 if (touch_selection_controller_) | 1877 if (touch_selection_controller_) |
| 1877 touch_selection_controller_->HideAndDisallowShowingAutomatically(); | 1878 touch_selection_controller_->HideAndDisallowShowingAutomatically(); |
| 1878 } | 1879 } |
| 1879 | 1880 |
| 1880 void RenderWidgetHostViewAndroid::SetTextHandlesTemporarilyHidden(bool hidden) { | 1881 void RenderWidgetHostViewAndroid::SetTextHandlesTemporarilyHidden(bool hidden) { |
| 1881 if (touch_selection_controller_) | 1882 if (touch_selection_controller_) |
| 1882 touch_selection_controller_->SetTemporarilyHidden(hidden); | 1883 touch_selection_controller_->SetTemporarilyHidden(hidden); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 float y0, | 2167 float y0, |
| 2167 float x1, | 2168 float x1, |
| 2168 float y1) { | 2169 float y1) { |
| 2169 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1)); | 2170 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1)); |
| 2170 } | 2171 } |
| 2171 | 2172 |
| 2172 void RenderWidgetHostViewAndroid::OnStylusSelectUpdate(float x, float y) { | 2173 void RenderWidgetHostViewAndroid::OnStylusSelectUpdate(float x, float y) { |
| 2173 MoveRangeSelectionExtent(gfx::PointF(x, y)); | 2174 MoveRangeSelectionExtent(gfx::PointF(x, y)); |
| 2174 } | 2175 } |
| 2175 | 2176 |
| 2177 void RenderWidgetHostViewAndroid::OnStylusSelectEnd(float x, float y) { |
| 2178 ShowContextMenuAtPoint(gfx::Point(x, y), ui::MENU_SOURCE_STYLUS); |
| 2179 } |
| 2180 |
| 2176 void RenderWidgetHostViewAndroid::OnStylusSelectTap(base::TimeTicks time, | 2181 void RenderWidgetHostViewAndroid::OnStylusSelectTap(base::TimeTicks time, |
| 2177 float x, | 2182 float x, |
| 2178 float y) { | 2183 float y) { |
| 2179 // Treat the stylus tap as a long press, activating either a word selection or | 2184 // Treat the stylus tap as a long press, activating either a word selection or |
| 2180 // context menu depending on the targetted content. | 2185 // context menu depending on the targetted content. |
| 2181 blink::WebGestureEvent long_press = WebGestureEventBuilder::Build( | 2186 blink::WebGestureEvent long_press = WebGestureEventBuilder::Build( |
| 2182 blink::WebInputEvent::kGestureLongPress, | 2187 blink::WebInputEvent::kGestureLongPress, |
| 2183 (time - base::TimeTicks()).InSecondsF(), x, y); | 2188 (time - base::TimeTicks()).InSecondsF(), x, y); |
| 2184 SendGestureEvent(long_press); | 2189 SendGestureEvent(long_press); |
| 2185 } | 2190 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 | 2247 |
| 2243 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2248 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2244 if (!compositor) | 2249 if (!compositor) |
| 2245 return; | 2250 return; |
| 2246 | 2251 |
| 2247 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2252 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2248 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2253 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| 2249 } | 2254 } |
| 2250 | 2255 |
| 2251 } // namespace content | 2256 } // namespace content |
| OLD | NEW |