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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
931 return weak_ptr_factory_.GetWeakPtr(); | 931 return weak_ptr_factory_.GetWeakPtr(); |
932 } | 932 } |
933 | 933 |
934 bool RenderWidgetHostViewAndroid::OnTouchEvent( | 934 bool RenderWidgetHostViewAndroid::OnTouchEvent( |
935 const ui::MotionEvent& event) { | 935 const ui::MotionEvent& event) { |
936 if (!host_ || !host_->delegate()) | 936 if (!host_ || !host_->delegate()) |
937 return false; | 937 return false; |
938 | 938 |
939 ComputeEventLatencyOSTouchHistograms(event); | 939 ComputeEventLatencyOSTouchHistograms(event); |
940 | 940 |
941 // Receiving any other touch event before the double-tap timeout expires | |
rlanday
2017/06/07 04:03:54
This matches the behavior of the native Android te
| |
942 // cancels opening the spellcheck menu. | |
943 if (ime_adapter_android_) | |
944 ime_adapter_android_->StopSpellCheckMenuTimer(); | |
945 | |
941 // If a browser-based widget consumes the touch event, it's critical that | 946 // If a browser-based widget consumes the touch event, it's critical that |
942 // touch event interception be disabled. This avoids issues with | 947 // touch event interception be disabled. This avoids issues with |
943 // double-handling for embedder-detected gestures like side swipe. | 948 // double-handling for embedder-detected gestures like side swipe. |
944 if (touch_selection_controller_ && | 949 if (touch_selection_controller_ && |
945 touch_selection_controller_->WillHandleTouchEvent(event)) { | 950 touch_selection_controller_->WillHandleTouchEvent(event)) { |
946 RequestDisallowInterceptTouchEvent(); | 951 RequestDisallowInterceptTouchEvent(); |
947 return true; | 952 return true; |
948 } | 953 } |
949 | 954 |
950 if (stylus_text_selector_.OnTouchEvent(event)) { | 955 if (stylus_text_selector_.OnTouchEvent(event)) { |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2250 | 2255 |
2251 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2256 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
2252 if (!compositor) | 2257 if (!compositor) |
2253 return; | 2258 return; |
2254 | 2259 |
2255 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2260 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2256 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2261 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
2257 } | 2262 } |
2258 | 2263 |
2259 } // namespace content | 2264 } // namespace content |
OLD | NEW |