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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java

Issue 1887173003: Fix an issue that referrer field is no longer exposed to pdfviewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.externalnav; 5 package org.chromium.chrome.browser.externalnav;
6 6
7 import android.Manifest.permission; 7 import android.Manifest.permission;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.DialogInterface; 10 import android.content.DialogInterface;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 activityResolved = true; 120 activityResolved = true;
121 boolean canSelfOpen = false; 121 boolean canSelfOpen = false;
122 boolean hasPdfViewer = false; 122 boolean hasPdfViewer = false;
123 for (ResolveInfo resolveInfo : handlers) { 123 for (ResolveInfo resolveInfo : handlers) {
124 String pName = resolveInfo.activityInfo.packageName; 124 String pName = resolveInfo.activityInfo.packageName;
125 if (packageName.equals(pName)) { 125 if (packageName.equals(pName)) {
126 canSelfOpen = true; 126 canSelfOpen = true;
127 } else if (PDF_VIEWER.equals(pName)) { 127 } else if (PDF_VIEWER.equals(pName)) {
128 if (isPdfIntent(intent)) { 128 if (isPdfIntent(intent)) {
129 intent.setClassName(pName, resolveInfo.activ ityInfo.name); 129 intent.setClassName(pName, resolveInfo.activ ityInfo.name);
130 Uri referrer = new Uri.Builder().scheme(
131 IntentHandler.ANDROID_APP_REFERRER_S CHEME).authority(
132 packageName).build();
133 intent.putExtra(Intent.EXTRA_REFERRER, refer rer);
130 hasPdfViewer = true; 134 hasPdfViewer = true;
131 break; 135 break;
132 } 136 }
133 } 137 }
134 } 138 }
135 if ((canSelfOpen && !allowSelfOpen) && !hasPdfViewer) { 139 if ((canSelfOpen && !allowSelfOpen) && !hasPdfViewer) {
136 activityResolved = false; 140 activityResolved = false;
137 } 141 }
138 } 142 }
139 } 143 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } 464 }
461 } 465 }
462 466
463 private void closeTab(Tab tab) { 467 private void closeTab(Tab tab) {
464 Context context = tab.getWindowAndroid().getContext().get(); 468 Context context = tab.getWindowAndroid().getContext().get();
465 if (context instanceof ChromeActivity) { 469 if (context instanceof ChromeActivity) {
466 ((ChromeActivity) context).getTabModelSelector().closeTab(tab); 470 ((ChromeActivity) context).getTabModelSelector().closeTab(tab);
467 } 471 }
468 } 472 }
469 } 473 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698