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

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

Issue 2891583004: [Android] Fix 'open in browser' in CCT does not work for images in Google image search (Closed)
Patch Set: Set Intent directly sent to ChromeLaucherActivity. Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ca251af34e9451fabdb9eede12177d1ff6a875d..d2e8038aaff86c4608c463ce9b47045dbdbd9ee2 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
@@ -643,15 +643,16 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
}
/**
- * The valid url of a link is stored in the linkUrl of ContextMenuParams while the
- * valid url of a image or video is stored in the srcUrl of ContextMenuParams.
- * @param params The parameters used to decide the type of the content.
+ * Return the valid url of a ContextMenuParams.
+ * If the ContextMenuParams is an anchor and its linkUrl is not empty, returns the linkUrl.
+ * Otherwise returns the srcUrl.
+ * @param params The {@link ContextMenuParams} to check.
*/
private String getUrl(ContextMenuParams params) {
- if (params.isImage() || params.isVideo()) {
- return params.getSrcUrl();
- } else {
+ if (params.isAnchor()) {
return params.getLinkUrl();
+ } else {
+ return params.getSrcUrl();
}
}
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698