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

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

Issue 1284743003: Add referrer through service connection in custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 4 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/customtabs/CustomTab.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/IntentHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
index 0fa84e26471f45ac76ca94b84fca36fb559e15e0..4307048b6247face1407b1a134867dd4312574fe 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
@@ -285,9 +285,8 @@ public class IntentHandler {
* Intent.
*
* @return Whether the Intent was successfully handled.
- * TODO(mariakhomenko): make package protected after ChromeTabbedActivity is upstreamed.
*/
- public boolean onNewIntent(Context context, Intent intent) {
+ boolean onNewIntent(Context context, Intent intent) {
assert intentHasValidUrl(intent);
String url = getUrlFromIntent(intent);
boolean hasUserGesture =
@@ -399,6 +398,16 @@ public class IntentHandler {
}
/**
+ * Constructs a valid referrer using the given authority.
+ * @param authority The authority to use.
+ * @return Referrer with default policy that uses the valid android app scheme.
+ */
+ public static Referrer constructValidReferrerForAuthority(String authority) {
+ return new Referrer(new Uri.Builder().scheme(ANDROID_APP_REFERRER_SCHEME)
+ .authority(authority).build().toString(), Referrer.REFERRER_POLICY_DEFAULT);
+ }
+
+ /**
* Extracts the URL from voice search result intent.
* @return URL if it was found, null otherwise.
*/
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTab.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698