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

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

Issue 494093003: On tapping the disabled option in context menu should not close the menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding name in Authors file Created 6 years, 4 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
« no previous file with comments | « AUTHORS ('k') | no next file » | 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.content.Context; 7 import android.content.Context;
8 import android.os.Build; 8 import android.os.Build;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 import android.view.ContextMenu; 10 import android.view.ContextMenu;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 menu.setGroupVisible(R.id.contextmenu_group_video, params.isVideo()); 51 menu.setGroupVisible(R.id.contextmenu_group_video, params.isVideo());
52 52
53 if (mDelegate.isIncognito() || !mDelegate.isIncognitoSupported()) { 53 if (mDelegate.isIncognito() || !mDelegate.isIncognitoSupported()) {
54 menu.findItem(R.id.contextmenu_open_in_incognito_tab).setVisible(fal se); 54 menu.findItem(R.id.contextmenu_open_in_incognito_tab).setVisible(fal se);
55 } 55 }
56 56
57 if (params.getLinkText().trim().isEmpty()) { 57 if (params.getLinkText().trim().isEmpty()) {
58 menu.findItem(R.id.contextmenu_copy_link_text).setVisible(false); 58 menu.findItem(R.id.contextmenu_copy_link_text).setVisible(false);
59 } 59 }
60 60
61 menu.findItem(R.id.contextmenu_save_link_as).setEnabled( 61 menu.findItem(R.id.contextmenu_save_link_as).setVisible(
62 UrlUtilities.isDownloadableScheme(params.getLinkUrl())); 62 UrlUtilities.isDownloadableScheme(params.getLinkUrl()));
63 63
64 if (params.isVideo()) { 64 if (params.isVideo()) {
65 menu.findItem(R.id.contextmenu_save_video).setEnabled( 65 menu.findItem(R.id.contextmenu_save_video).setVisible(
66 UrlUtilities.isDownloadableScheme(params.getSrcUrl())); 66 UrlUtilities.isDownloadableScheme(params.getSrcUrl()));
67 } else if (params.isImage()) { 67 } else if (params.isImage()) {
68 menu.findItem(R.id.contextmenu_save_image).setEnabled( 68 menu.findItem(R.id.contextmenu_save_image).setVisible(
69 UrlUtilities.isDownloadableScheme(params.getSrcUrl())); 69 UrlUtilities.isDownloadableScheme(params.getSrcUrl()));
70 70
71 if (mDelegate.canLoadOriginalImage()) { 71 if (mDelegate.canLoadOriginalImage()) {
72 menu.findItem(R.id.contextmenu_open_image_in_new_tab).setVisible (false); 72 menu.findItem(R.id.contextmenu_open_image_in_new_tab).setVisible (false);
73 } else { 73 } else {
74 menu.findItem(R.id.contextmenu_open_original_image_in_new_tab).s etVisible(false); 74 menu.findItem(R.id.contextmenu_open_original_image_in_new_tab).s etVisible(false);
75 } 75 }
76 76
77 // Avoid showing open image option for same image which is already o pened. 77 // Avoid showing open image option for same image which is already o pened.
78 if (mDelegate.getPageUrl().equals(params.getSrcUrl())) { 78 if (mDelegate.getPageUrl().equals(params.getSrcUrl())) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 mDelegate.onSaveImageToClipboard(params.getSrcUrl()); 124 mDelegate.onSaveImageToClipboard(params.getSrcUrl());
125 } else if (itemId == R.id.contextmenu_copy_image_url) { 125 } else if (itemId == R.id.contextmenu_copy_image_url) {
126 mDelegate.onSaveToClipboard(params.getSrcUrl(), true); 126 mDelegate.onSaveToClipboard(params.getSrcUrl(), true);
127 } else { 127 } else {
128 assert false; 128 assert false;
129 } 129 }
130 130
131 return true; 131 return true;
132 } 132 }
133 } 133 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698