Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 717573004: [Android] Thoroughly reset gesture detection upon page navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 732
733 bool RenderWidgetHostViewAndroid::OnTouchHandleEvent( 733 bool RenderWidgetHostViewAndroid::OnTouchHandleEvent(
734 const ui::MotionEvent& event) { 734 const ui::MotionEvent& event) {
735 return selection_controller_ && 735 return selection_controller_ &&
736 selection_controller_->WillHandleTouchEvent(event); 736 selection_controller_->WillHandleTouchEvent(event);
737 } 737 }
738 738
739 void RenderWidgetHostViewAndroid::ResetGestureDetection() { 739 void RenderWidgetHostViewAndroid::ResetGestureDetection() {
740 const ui::MotionEvent* current_down_event = 740 const ui::MotionEvent* current_down_event =
741 gesture_provider_.GetCurrentDownEvent(); 741 gesture_provider_.GetCurrentDownEvent();
742 if (!current_down_event) 742 if (current_down_event) {
743 return; 743 scoped_ptr<ui::MotionEvent> cancel_event = current_down_event->Cancel();
744 OnTouchEvent(*cancel_event);
745 }
744 746
745 scoped_ptr<ui::MotionEvent> cancel_event = current_down_event->Cancel(); 747 // A hard reset ensures prevention of any timer-based events.
746 DCHECK(cancel_event); 748 gesture_provider_.ResetDetection();
747 OnTouchEvent(*cancel_event);
748 } 749 }
749 750
750 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { 751 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) {
751 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); 752 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled);
752 } 753 }
753 754
754 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( 755 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled(
755 bool enabled) { 756 bool enabled) {
756 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); 757 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled);
757 } 758 }
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 results->orientationAngle = display.RotationAsDegree(); 1812 results->orientationAngle = display.RotationAsDegree();
1812 results->orientationType = 1813 results->orientationType =
1813 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1814 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1814 gfx::DeviceDisplayInfo info; 1815 gfx::DeviceDisplayInfo info;
1815 results->depth = info.GetBitsPerPixel(); 1816 results->depth = info.GetBitsPerPixel();
1816 results->depthPerComponent = info.GetBitsPerComponent(); 1817 results->depthPerComponent = info.GetBitsPerComponent();
1817 results->isMonochrome = (results->depthPerComponent == 0); 1818 results->isMonochrome = (results->depthPerComponent == 0);
1818 } 1819 }
1819 1820
1820 } // namespace content 1821 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698