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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 1366453002: Fix a crash that custom tab sends reader mode urls in intent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | no next file » | 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/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 4ae81a1abcb31598b69cc13c93b9ac314ab86dbf..96aef3165bdbed0a6327cdf246a1417ae0bea00b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -40,6 +40,7 @@ import org.chromium.chrome.browser.toolbar.ToolbarControlContainer;
import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.chrome.browser.widget.findinpage.FindToolbarManager;
+import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.common.Referrer;
@@ -393,6 +394,9 @@ public class CustomTabActivity extends ChromeActivity {
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
if (id == R.id.open_in_chrome_id) {
String url = getTabModelSelector().getCurrentTab().getUrl();
+ if (DomDistillerUrlUtils.isDistilledPage(url)) {
+ url = DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(url);
+ }
Intent chromeIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
chromeIntent.setPackage(getApplicationContext().getPackageName());
chromeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698