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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java

Issue 1547543003: Record UMA for Physical Web settings fragment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add UMA for location permission request 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/preferences/privacy/PhysicalWebPreferenceFragment.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java
index 5eedd4d682ef9a668d316feccc3fd951f03dd290..e5e889b4909a289d51291aa6e39120c0d3fa6d10 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java
@@ -14,6 +14,7 @@ import android.preference.PreferenceFragment;
import org.chromium.base.Log;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.physicalweb.PhysicalWebUma;
import org.chromium.chrome.browser.preferences.ChromeSwitchPreference;
/**
@@ -53,14 +54,15 @@ public class PhysicalWebPreferenceFragment extends PreferenceFragment {
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[],
int[] grantResults) {
- // TODO(cco3): Add UMA here.
switch (requestCode) {
case REQUEST_ID:
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ PhysicalWebUma.onPrefsLocationGranted(getActivity());
Log.d(TAG, "Location permission granted");
} else {
- Log.d(TAG, "Location permission rejected");
+ PhysicalWebUma.onPrefsLocationDenied(getActivity());
+ Log.d(TAG, "Location permission denied");
}
break;
default:
@@ -84,8 +86,10 @@ public class PhysicalWebPreferenceFragment extends PreferenceFragment {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if ((boolean) newValue) {
+ PhysicalWebUma.onPrefsFeatureEnabled(getActivity());
ensureLocationPermission();
} else {
+ PhysicalWebUma.onPrefsFeatureDisabled(getActivity());
setPhysicalWebEnabled(false);
}
return true;
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698