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

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

Issue 398803002: Context menu for image is not having any option to copy image URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
index 496e81def3560abef6d80be3a63d260d90c79725..b8e79d094f94b395bfec920661307dbc7931dcb4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -75,6 +75,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
menu.findItem(R.id.contextmenu_open_original_image_in_new_tab).setVisible(false);
}
+ // Avoid showing open image option for same image which is already opened.
+ if (mDelegate.getPageUrl().equals(params.getSrcUrl())) {
+ menu.findItem(R.id.contextmenu_open_image).setVisible(false);
+ }
Bernhard Bauer 2014/07/16 13:21:57 This is from a different CL.
final TemplateUrlService templateUrlServiceInstance = TemplateUrlService.getInstance();
final boolean isSearchByImageAvailable =
UrlUtilities.isDownloadableScheme(params.getSrcUrl()) &&
@@ -119,6 +123,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
mDelegate.onSearchByImageInNewTab();
} else if (itemId == R.id.contextmenu_copy_image) {
mDelegate.onSaveImageToClipboard(params.getSrcUrl());
+ } else if (itemId == R.id.contextmenu_copy_image_address) {
+ mDelegate.onSaveToClipboard(params.getSrcUrl(), true);
} else {
assert false;
}

Powered by Google App Engine
This is Rietveld 408576698