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; |
+ } |
+} |