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

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

Issue 2962523003: Improve histogram and actions for CBD dialog (Closed)
Patch Set: Improve histogram summary Created 3 years, 6 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/preferences/privacy/ClearBrowsingDataTabsFragment.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/preferences/privacy/ClearBrowsingDataPreferences.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
index ddfd3beb24195ceaddc38ddfd350a6cbc8f32478..1b4964b4d4063363b215720c087a597d0d5c4e01 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
@@ -9,6 +9,7 @@ import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.SystemClock;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.annotation.Nullable;
@@ -41,6 +42,7 @@ import org.chromium.components.signin.ChromeSigninController;
import java.util.Arrays;
import java.util.EnumSet;
+import java.util.concurrent.TimeUnit;
/**
* Preference screen that allows the user to clear browsing data.
@@ -289,6 +291,8 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
// This is the dialog we show to the user that lets them 'uncheck' (or exclude) the above
// important domains from being cleared.
private ConfirmImportantSitesDialogFragment mConfirmImportantSitesDialog;
+ // Time in ms, when the dialog was created.
+ private long mDialogOpened;
/**
* @return The currently selected DialogOptions.
@@ -310,6 +314,9 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
@Nullable String[] ignoredDomains, @Nullable int[] ignoredDomainReasons) {
showProgressDialog();
+ RecordHistogram.recordMediumTimesHistogram("History.ClearBrowsingData.TimeSpentInDialog",
+ SystemClock.elapsedRealtime() - mDialogOpened, TimeUnit.MILLISECONDS);
+
int[] dataTypes = new int[options.size()];
int i = 0;
for (DialogOption option : options) {
@@ -505,6 +512,8 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
+ mDialogOpened = SystemClock.elapsedRealtime();
// Don't record this action if TabsInCBD is enabled because this class is created twice.
// The action will be recorded in ClearBrowsingDataTabsFragment instead.
if (!ClearBrowsingDataTabsFragment.isFeatureEnabled()) {
@@ -549,7 +558,6 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
// The time range selection spinner.
SpinnerPreference spinner = (SpinnerPreference) findPreference(PREF_TIME_RANGE);
- spinner.setOnPreferenceChangeListener(this);
TimePeriodSpinnerOption[] spinnerOptions = getTimePeriodSpinnerOptions();
int selectedTimePeriod = PrefServiceBridge.getInstance().getBrowsingDataDeletionTimePeriod(
getPreferenceType());
@@ -562,6 +570,7 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
}
assert spinnerOptionIndex != -1;
spinner.setOptions(spinnerOptions, spinnerOptionIndex);
+ spinner.setOnPreferenceChangeListener(this);
initClearButtonPreference();
initFootnote();
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698