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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java

Issue 199733002: Cleanup AppMenu code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move lint suppression to AppMenuDragHelper Created 6 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 package org.chromium.chrome.browser.appmenu; 5 package org.chromium.chrome.browser.appmenu;
6 6
7 import android.view.GestureDetector; 7 import android.view.GestureDetector;
8 import android.view.GestureDetector.SimpleOnGestureListener; 8 import android.view.GestureDetector.SimpleOnGestureListener;
9 import android.view.MotionEvent; 9 import android.view.MotionEvent;
10 import android.view.View; 10 import android.view.View;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 event.getActionMasked() == MotionEvent.ACTION_UP) { 107 event.getActionMasked() == MotionEvent.ACTION_UP) {
108 mMenuButton.setPressed(false); 108 mMenuButton.setPressed(false);
109 } 109 }
110 110
111 // This will take care of showing app menu. 111 // This will take care of showing app menu.
112 boolean isTouchEventConsumed = mAppMenuGestureDetector.onTouchEvent(even t); 112 boolean isTouchEventConsumed = mAppMenuGestureDetector.onTouchEvent(even t);
113 113
114 // If user starts to drag on this menu button, ACTION_DOWN and all the s ubsequent touch 114 // If user starts to drag on this menu button, ACTION_DOWN and all the s ubsequent touch
115 // events are received here. We need to forward this event to the app me nu to handle 115 // events are received here. We need to forward this event to the app me nu to handle
116 // dragging correctly. 116 // dragging correctly.
117 AppMenu menu = mMenuHandler.getAppMenu(); 117 AppMenuDragHelper dragHelper = mMenuHandler.getAppMenuDragHelper();
118 if (menu != null && !isTouchEventConsumed) { 118 if (dragHelper != null && !isTouchEventConsumed) {
119 isTouchEventConsumed |= menu.handleDragging(event); 119 isTouchEventConsumed |= dragHelper.handleDragging(event);
120 } 120 }
121 return isTouchEventConsumed; 121 return isTouchEventConsumed;
122 } 122 }
123 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698