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

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

Issue 2755003003: Add Interstitial for user consent (Closed)
Patch Set: Matts Nits 1 Created 3 years, 9 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
Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
index 09891aa8bbbe61dbc91eb2978a1d954d048f65cc..a25b522608e74d2035350b5a1b7c2e52578662a0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
@@ -4,9 +4,9 @@
package org.chromium.chrome.browser.physicalweb;
-import android.content.Intent;
import android.os.Build;
+import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.share.ShareActivity;
@@ -18,9 +18,13 @@ public class PhysicalWebShareActivity extends ShareActivity {
protected void handleShareAction(ChromeActivity triggeringActivity) {
String url = triggeringActivity.getActivityTab().getUrl();
- Intent intent = new Intent(this, PhysicalWebBroadcastService.class);
- intent.putExtra(PhysicalWebBroadcastService.DISPLAY_URL_KEY, url);
- startService(intent);
+ if (!PhysicalWeb.sharingIsOptedIn()) {
+ // This shows an interstitial for the user to opt-in for sending URL to Google.
+ triggeringActivity.onMenuOrKeyboardAction(R.id.physical_web_sharing_id, true);
Ted C 2017/03/21 00:01:22 what happens here if you were to do triggeringActi
iankc 2017/03/21 01:19:52 This works without the Flag.
+ return;
+ }
+
+ PhysicalWebBroadcastService.startBroadcastService(url);
}
/**

Powered by Google App Engine
This is Rietveld 408576698