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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 // notifications are no longer required, crbug.com/398170. | 1631 // notifications are no longer required, crbug.com/398170. |
1632 gfx::SelectionBound insertion_bound; | 1632 gfx::SelectionBound insertion_bound; |
1633 insertion_bound.set_type(gfx::SelectionBound::CENTER); | 1633 insertion_bound.set_type(gfx::SelectionBound::CENTER); |
1634 insertion_bound.set_visible(true); | 1634 insertion_bound.set_visible(true); |
1635 insertion_bound.SetEdge(point, point); | 1635 insertion_bound.SetEdge(point, point); |
1636 selection_controller_->HideAndDisallowShowingAutomatically(); | 1636 selection_controller_->HideAndDisallowShowingAutomatically(); |
1637 selection_controller_->OnSelectionEditable(true); | 1637 selection_controller_->OnSelectionEditable(true); |
1638 selection_controller_->OnSelectionEmpty(true); | 1638 selection_controller_->OnSelectionEmpty(true); |
1639 selection_controller_->OnSelectionBoundsChanged(insertion_bound, | 1639 selection_controller_->OnSelectionBoundsChanged(insertion_bound, |
1640 insertion_bound); | 1640 insertion_bound); |
1641 selection_controller_->AllowShowingFromCurrentSelection(); | |
1642 } | 1641 } |
1643 | 1642 |
1644 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { | 1643 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { |
1645 return cached_background_color_; | 1644 return cached_background_color_; |
1646 } | 1645 } |
1647 | 1646 |
1648 void RenderWidgetHostViewAndroid::DidOverscroll( | 1647 void RenderWidgetHostViewAndroid::DidOverscroll( |
1649 const DidOverscrollParams& params) { | 1648 const DidOverscrollParams& params) { |
1650 if (sync_compositor_) | 1649 if (sync_compositor_) |
1651 sync_compositor_->DidOverscroll(params); | 1650 sync_compositor_->DidOverscroll(params); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 float y0, | 1925 float y0, |
1927 float x1, | 1926 float x1, |
1928 float y1) { | 1927 float y1) { |
1929 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1)); | 1928 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1)); |
1930 } | 1929 } |
1931 | 1930 |
1932 void RenderWidgetHostViewAndroid::OnStylusSelectUpdate(float x, float y) { | 1931 void RenderWidgetHostViewAndroid::OnStylusSelectUpdate(float x, float y) { |
1933 MoveRangeSelectionExtent(gfx::PointF(x, y)); | 1932 MoveRangeSelectionExtent(gfx::PointF(x, y)); |
1934 } | 1933 } |
1935 | 1934 |
1936 void RenderWidgetHostViewAndroid::OnStylusSelectEnd() { | |
1937 if (selection_controller_) | |
1938 selection_controller_->AllowShowingFromCurrentSelection(); | |
1939 } | |
1940 | |
1941 void RenderWidgetHostViewAndroid::OnStylusSelectTap(base::TimeTicks time, | 1935 void RenderWidgetHostViewAndroid::OnStylusSelectTap(base::TimeTicks time, |
1942 float x, | 1936 float x, |
1943 float y) { | 1937 float y) { |
1944 // Treat the stylus tap as a long press, activating either a word selection or | 1938 // Treat the stylus tap as a long press, activating either a word selection or |
1945 // context menu depending on the targetted content. | 1939 // context menu depending on the targetted content. |
1946 blink::WebGestureEvent long_press = WebGestureEventBuilder::Build( | 1940 blink::WebGestureEvent long_press = WebGestureEventBuilder::Build( |
1947 blink::WebInputEvent::GestureLongPress, | 1941 blink::WebInputEvent::GestureLongPress, |
1948 (time - base::TimeTicks()).InSecondsF(), x, y); | 1942 (time - base::TimeTicks()).InSecondsF(), x, y); |
1949 SendGestureEvent(long_press); | 1943 SendGestureEvent(long_press); |
1950 } | 1944 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 case ui::MotionEvent::ACTION_UP: | 1978 case ui::MotionEvent::ACTION_UP: |
1985 case ui::MotionEvent::ACTION_POINTER_UP: | 1979 case ui::MotionEvent::ACTION_POINTER_UP: |
1986 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1980 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
1987 delta.InMicroseconds(), 1, 1000000, 50); | 1981 delta.InMicroseconds(), 1, 1000000, 50); |
1988 default: | 1982 default: |
1989 return; | 1983 return; |
1990 } | 1984 } |
1991 } | 1985 } |
1992 | 1986 |
1993 } // namespace content | 1987 } // namespace content |
OLD | NEW |