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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 return weak_ptr_factory_.GetWeakPtr(); | 932 return weak_ptr_factory_.GetWeakPtr(); |
933 } | 933 } |
934 | 934 |
935 bool RenderWidgetHostViewAndroid::OnTouchEvent( | 935 bool RenderWidgetHostViewAndroid::OnTouchEvent( |
936 const ui::MotionEvent& event) { | 936 const ui::MotionEvent& event) { |
937 if (!host_ || !host_->delegate()) | 937 if (!host_ || !host_->delegate()) |
938 return false; | 938 return false; |
939 | 939 |
940 ComputeEventLatencyOSTouchHistograms(event); | 940 ComputeEventLatencyOSTouchHistograms(event); |
941 | 941 |
| 942 // Receiving any other touch event before the double-tap timeout expires |
| 943 // cancels opening the spellcheck menu. |
| 944 if (ime_adapter_android_) |
| 945 ime_adapter_android_->StopSpellCheckMenuTimer(); |
| 946 |
942 // If a browser-based widget consumes the touch event, it's critical that | 947 // If a browser-based widget consumes the touch event, it's critical that |
943 // touch event interception be disabled. This avoids issues with | 948 // touch event interception be disabled. This avoids issues with |
944 // double-handling for embedder-detected gestures like side swipe. | 949 // double-handling for embedder-detected gestures like side swipe. |
945 if (touch_selection_controller_ && | 950 if (touch_selection_controller_ && |
946 touch_selection_controller_->WillHandleTouchEvent(event)) { | 951 touch_selection_controller_->WillHandleTouchEvent(event)) { |
947 RequestDisallowInterceptTouchEvent(); | 952 RequestDisallowInterceptTouchEvent(); |
948 return true; | 953 return true; |
949 } | 954 } |
950 | 955 |
951 if (stylus_text_selector_.OnTouchEvent(event)) { | 956 if (stylus_text_selector_.OnTouchEvent(event)) { |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 | 2287 |
2283 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2288 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
2284 if (!compositor) | 2289 if (!compositor) |
2285 return; | 2290 return; |
2286 | 2291 |
2287 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2292 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2288 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2293 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
2289 } | 2294 } |
2290 | 2295 |
2291 } // namespace content | 2296 } // namespace content |
OLD | NEW |