summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-10-08 17:54:24 +0100
committerSteve Block <steveblock@google.com>2010-10-08 19:42:06 +0100
commit47f7d8d0b36b54a5934daaa6975e05c87e761383 (patch)
tree1e285ea6d590044d711a80bc30e964741c102d2d /src/com/android
parente421c2472744ca7d35906f86204790ee97b91ca2 (diff)
downloadpackages_apps_Browser-47f7d8d0b36b54a5934daaa6975e05c87e761383.tar.gz
packages_apps_Browser-47f7d8d0b36b54a5934daaa6975e05c87e761383.tar.bz2
packages_apps_Browser-47f7d8d0b36b54a5934daaa6975e05c87e761383.zip
Add a conformation dialog when clearing the browser history
This adds a confirmation dialog when clearing the browser history from the main browser menu or from the history page menu. This matches the behaviour of the clear history option on the browser settings page. Bug: 2149140 Change-Id: I6f0f5910b5df20aa5b43263165cb3cfbbed6b87d
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 72d8c28a7..ab622b16c 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -17,11 +17,14 @@
package com.android.browser;
import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
import android.app.Fragment;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.CursorLoader;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.Loader;
import android.content.pm.PackageManager;
@@ -200,8 +203,22 @@ public class BrowserHistoryPage extends Fragment
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.clear_history_menu_id:
- Browser.clearHistory(getActivity().getContentResolver());
- mCallbacks.onRemoveParentChildRelationships();
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.clear)
+ .setMessage(R.string.pref_privacy_clear_history_dlg)
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setNegativeButton(R.string.cancel, null)
+ .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ if (which == DialogInterface.BUTTON_POSITIVE) {
+ Browser.clearHistory(getActivity().getContentResolver());
+ mCallbacks.onRemoveParentChildRelationships();
+ }
+ }
+ });
+ final Dialog dialog = builder.create();
+ dialog.show();
return true;
default: