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

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

Issue 1526323003: Add Physical Web opt-in dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused namespace in layout xml Created 5 years 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/PhysicalWebOptInActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..33b7b8c9e09b8fae40a66218d550d000f558efe1
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.physicalweb;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
+
+/**
+ * This activity invites the user to opt-in to the Physical Web feature.
+ */
+public class PhysicalWebOptInActivity extends AppCompatActivity {
+ private static final String TAG = "PhysicalWeb";
gone 2015/12/28 22:27:03 Don't add TAGs unless you actually use them for lo
mattreynolds 2015/12/28 23:11:22 Removed
+ private Button mDeclineButton;
+ private Button mEnableButton;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.physical_web_optin);
+
+ mDeclineButton = (Button) findViewById(R.id.physical_web_decline);
+ mDeclineButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PrivacyPreferencesManager privacyPrefManager =
+ PrivacyPreferencesManager.getInstance(PhysicalWebOptInActivity.this);
+ privacyPrefManager.setPhysicalWebEnabled(false);
+ finish();
+ }
+ });
+
+ mEnableButton = (Button) findViewById(R.id.physical_web_enable);
+ mEnableButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PrivacyPreferencesManager privacyPrefManager =
+ PrivacyPreferencesManager.getInstance(PhysicalWebOptInActivity.this);
+ privacyPrefManager.setPhysicalWebEnabled(true);
+ startActivity(createListUrlsIntent());
+ finish();
+ }
+ });
+ }
+
+ private Intent createListUrlsIntent() {
gone 2015/12/28 22:27:03 nit: static?
mattreynolds 2015/12/28 23:11:22 Done.
+ Intent intent = new Intent(this, ListUrlsActivity.class);
+ intent.putExtra(ListUrlsActivity.REFERER_KEY,
+ ListUrlsActivity.OPTIN_REFERER);
+ return intent;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698