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

Side by Side 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 unified diff | 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 »
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.net.MailTo; 8 import android.net.MailTo;
9 import android.support.annotation.IntDef; 9 import android.support.annotation.IntDef;
10 import android.support.annotation.StringRes; 10 import android.support.annotation.StringRes;
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 * @return True if the url is empty or "about:blank". 636 * @return True if the url is empty or "about:blank".
637 */ 637 */
638 private boolean isEmptyUrl(String url) { 638 private boolean isEmptyUrl(String url) {
639 if (TextUtils.isEmpty(url) || url.equals(ContentUrlConstants.ABOUT_BLANK _DISPLAY_URL)) { 639 if (TextUtils.isEmpty(url) || url.equals(ContentUrlConstants.ABOUT_BLANK _DISPLAY_URL)) {
640 return true; 640 return true;
641 } 641 }
642 return false; 642 return false;
643 } 643 }
644 644
645 /** 645 /**
646 * The valid url of a link is stored in the linkUrl of ContextMenuParams whi le the 646 * Return the valid url of a ContextMenuParams.
647 * valid url of a image or video is stored in the srcUrl of ContextMenuParam s. 647 * If the ContextMenuParams is an anchor and its linkUrl is not empty, retur ns the linkUrl.
648 * @param params The parameters used to decide the type of the content. 648 * Otherwise returns the srcUrl.
649 * @param params The {@link ContextMenuParams} to check.
649 */ 650 */
650 private String getUrl(ContextMenuParams params) { 651 private String getUrl(ContextMenuParams params) {
651 if (params.isImage() || params.isVideo()) { 652 if (params.isAnchor()) {
653 return params.getLinkUrl();
654 } else {
652 return params.getSrcUrl(); 655 return params.getSrcUrl();
653 } else {
654 return params.getLinkUrl();
655 } 656 }
656 } 657 }
657 } 658 }
OLDNEW
« 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