Bug 1017633 - Update "Clear history" dialog button and add telemetry. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 29 May 2014 18:15:18 -0700
changeset 185727 dc5975c76fdabb850e6b027a3084a7f5dde38544
parent 185726 38c5e21a80fa1d8a8fd061bb0294913d92280cb2
child 185728 3540dc826ca8a93a54b42e8c8445e32ffc5a2bfe
push id7055
push usermleibovic@mozilla.com
push dateFri, 30 May 2014 01:15:44 +0000
treeherderfx-team@3540dc826ca8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1017633
milestone32.0a1
Bug 1017633 - Update "Clear history" dialog button and add telemetry. r=mfinkle
mobile/android/base/home/MostRecentPanel.java
mobile/android/base/preferences/PrivateDataPreference.java
--- a/mobile/android/base/home/MostRecentPanel.java
+++ b/mobile/android/base/home/MostRecentPanel.java
@@ -145,27 +145,29 @@ public class MostRecentPanel extends Hom
 
                 dialogBuilder.setNegativeButton(R.string.button_cancel, new AlertDialog.OnClickListener() {
                     @Override
                     public void onClick(final DialogInterface dialog, final int which) {
                         dialog.dismiss();
                     }
                 });
 
-                dialogBuilder.setPositiveButton(R.string.button_yes, new AlertDialog.OnClickListener() {
+                dialogBuilder.setPositiveButton(R.string.button_ok, new AlertDialog.OnClickListener() {
                     @Override
                     public void onClick(final DialogInterface dialog, final int which) {
                         dialog.dismiss();
                         ThreadUtils.postToBackgroundThread(new Runnable() {
                             @Override
                             public void run() {
                                 final ContentResolver cr = context.getContentResolver();
                                 BrowserDB.clearHistory(cr);
                             }
                         });
+
+                        Telemetry.sendUIEvent(TelemetryContract.Event.SANITIZE, TelemetryContract.Method.BUTTON, "history");
                     }
                 });
 
                 dialogBuilder.show();
             }
         });
     }
 
--- a/mobile/android/base/preferences/PrivateDataPreference.java
+++ b/mobile/android/base/preferences/PrivateDataPreference.java
@@ -27,17 +27,17 @@ class PrivateDataPreference extends Mult
 
     @Override
     protected void onDialogClosed(boolean positiveResult) {
         super.onDialogClosed(positiveResult);
 
         if (!positiveResult)
             return;
 
-        Telemetry.sendUIEvent(TelemetryContract.Event.SANITIZE, TelemetryContract.Method.DIALOG);
+        Telemetry.sendUIEvent(TelemetryContract.Event.SANITIZE, TelemetryContract.Method.DIALOG, "settings");
 
         CharSequence keys[] = getEntryKeys();
         boolean values[] = getValues();
         JSONObject json = new JSONObject();
 
         for (int i = 0; i < keys.length; i++) {
             // Privacy pref checkbox values are stored in Android prefs to
             // remember their check states. The key names are private.data.X,