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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java

Issue 660663002: Clear pending events upon main frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates 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 | chrome/browser/apps/web_view_browsertest.cc » ('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 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.contextmenu; 5 package org.chromium.chrome.browser.contextmenu;
6 6
7 import android.view.ContextMenu; 7 import android.view.ContextMenu;
8 import android.view.ContextMenu.ContextMenuInfo; 8 import android.view.ContextMenu.ContextMenuInfo;
9 import android.view.HapticFeedbackConstants; 9 import android.view.HapticFeedbackConstants;
10 import android.view.Menu; 10 import android.view.Menu;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (!shouldShowMenu(params) 61 if (!shouldShowMenu(params)
62 || view == null 62 || view == null
63 || view.getVisibility() != View.VISIBLE 63 || view.getVisibility() != View.VISIBLE
64 || view.getParent() == null) { 64 || view.getParent() == null) {
65 return; 65 return;
66 } 66 }
67 67
68 mCurrentContextMenuParams = params; 68 mCurrentContextMenuParams = params;
69 69
70 view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); 70 view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
71 contentViewCore.setIgnoreRemainingTouchEvents();
72 view.setOnCreateContextMenuListener(this); 71 view.setOnCreateContextMenuListener(this);
73 view.showContextMenu(); 72 view.showContextMenu();
74 } 73 }
75 74
76 /** 75 /**
77 * Starts a download based on the current {@link ContextMenuParams}. 76 * Starts a download based on the current {@link ContextMenuParams}.
78 * @param isLink Whether or not the download target is a link. 77 * @param isLink Whether or not the download target is a link.
79 */ 78 */
80 public void startContextMenuDownload(boolean isLink) { 79 public void startContextMenuDownload(boolean isLink) {
81 if (mNativeContextMenuHelper != 0) nativeOnStartDownload(mNativeContextM enuHelper, isLink); 80 if (mNativeContextMenuHelper != 0) nativeOnStartDownload(mNativeContextM enuHelper, isLink);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 120 }
122 121
123 private boolean shouldShowMenu(ContextMenuParams params) { 122 private boolean shouldShowMenu(ContextMenuParams params) {
124 // Custom menus are handled by this class and do not require a ContextMe nuPopulator. 123 // Custom menus are handled by this class and do not require a ContextMe nuPopulator.
125 return params.isCustomMenu() || 124 return params.isCustomMenu() ||
126 (mPopulator != null && mPopulator.shouldShowContextMenu(params)) ; 125 (mPopulator != null && mPopulator.shouldShowContextMenu(params)) ;
127 } 126 }
128 127
129 private native void nativeOnStartDownload(long nativeContextMenuHelper, bool ean isLink); 128 private native void nativeOnStartDownload(long nativeContextMenuHelper, bool ean isLink);
130 private native void nativeOnCustomItemSelected(long nativeContextMenuHelper, int action); 129 private native void nativeOnCustomItemSelected(long nativeContextMenuHelper, int action);
131 } 130 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/apps/web_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698