blob: 9c9b6ace6aeb790656ecbbf3ec6c6bd628793d45 [file] [log] [blame]
Nicolas Roarde46990e2009-06-19 16:27:49 +01001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.browser;
18
19import android.app.AlertDialog;
20import android.app.ListActivity;
21import android.content.Context;
22import android.content.DialogInterface;
23import android.database.Cursor;
24import android.graphics.Bitmap;
25import android.graphics.BitmapFactory;
26import android.net.Uri;
27import android.os.Bundle;
28import android.provider.Browser;
29import android.util.Log;
30import android.view.KeyEvent;
31import android.view.LayoutInflater;
Ben Murdochb9daacb2009-09-14 10:48:24 +010032import android.view.Menu;
33import android.view.MenuInflater;
34import android.view.MenuItem;
Nicolas Roarde46990e2009-06-19 16:27:49 +010035import android.view.View;
36import android.view.ViewGroup;
Steve Blockf344d032009-07-30 10:50:45 +010037import android.webkit.GeolocationPermissions;
Nicolas Roarde46990e2009-06-19 16:27:49 +010038import android.webkit.WebIconDatabase;
39import android.webkit.WebStorage;
40import android.widget.ArrayAdapter;
41import android.widget.AdapterView;
42import android.widget.AdapterView.OnItemClickListener;
43import android.widget.ImageView;
44import android.widget.TextView;
45
46import java.util.HashMap;
Steve Blockee0d6392009-07-28 13:49:15 +010047import java.util.HashSet;
Nicolas Roarde46990e2009-06-19 16:27:49 +010048import java.util.Iterator;
Steve Block089ce3a2009-07-29 17:16:01 +010049import java.util.Map;
Nicolas Roarde46990e2009-06-19 16:27:49 +010050import java.util.Set;
51import java.util.Vector;
52
53/**
54 * Manage the settings for an origin.
Steve Block089ce3a2009-07-29 17:16:01 +010055 * We use it to keep track of the 'HTML5' settings, i.e. database (webstorage)
56 * and Geolocation.
Nicolas Roarde46990e2009-06-19 16:27:49 +010057 */
58public class WebsiteSettingsActivity extends ListActivity {
59
60 private String LOGTAG = "WebsiteSettingsActivity";
61 private static String sMBStored = null;
62 private SiteAdapter mAdapter = null;
63
64 class Site {
65 private String mOrigin;
66 private String mTitle;
67 private Bitmap mIcon;
Steve Block089ce3a2009-07-29 17:16:01 +010068 private int mFeatures;
69
70 // These constants provide the set of features that a site may support
71 // They must be consecutive. To add a new feature, add a new FEATURE_XXX
72 // variable with value equal to the current value of FEATURE_COUNT, then
73 // increment FEATURE_COUNT.
74 private final static int FEATURE_WEB_STORAGE = 0;
Steve Blockf344d032009-07-30 10:50:45 +010075 private final static int FEATURE_GEOLOCATION = 1;
Steve Block089ce3a2009-07-29 17:16:01 +010076 // The number of features available.
Steve Blockf344d032009-07-30 10:50:45 +010077 private final static int FEATURE_COUNT = 2;
Nicolas Roarde46990e2009-06-19 16:27:49 +010078
Steve Block1ad98cf2009-07-28 11:07:10 +010079 public Site(String origin) {
Nicolas Roarde46990e2009-06-19 16:27:49 +010080 mOrigin = origin;
Steve Block1ad98cf2009-07-28 11:07:10 +010081 mTitle = null;
82 mIcon = null;
Steve Block089ce3a2009-07-29 17:16:01 +010083 mFeatures = 0;
84 }
85
86 public void addFeature(int feature) {
87 mFeatures |= (1 << feature);
88 }
89
90 public boolean hasFeature(int feature) {
91 return (mFeatures & (1 << feature)) != 0;
92 }
93
94 /**
95 * Gets the number of features supported by this site.
96 */
97 public int getFeatureCount() {
98 int count = 0;
99 for (int i = 0; i < FEATURE_COUNT; ++i) {
100 count += hasFeature(i) ? 1 : 0;
101 }
102 return count;
103 }
104
105 /**
106 * Gets the ID of the nth (zero-based) feature supported by this site.
107 * The return value is a feature ID - one of the FEATURE_XXX values.
108 * This is required to determine which feature is displayed at a given
109 * position in the list of features for this site. This is used both
Steve Blockf344d032009-07-30 10:50:45 +0100110 * when populating the view and when responding to clicks on the list.
Steve Block089ce3a2009-07-29 17:16:01 +0100111 */
112 public int getFeatureByIndex(int n) {
113 int j = -1;
114 for (int i = 0; i < FEATURE_COUNT; ++i) {
115 j += hasFeature(i) ? 1 : 0;
116 if (j == n) {
117 return i;
118 }
119 }
120 return -1;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100121 }
122
123 public String getOrigin() {
124 return mOrigin;
125 }
126
127 public void setTitle(String title) {
128 mTitle = title;
129 }
130
Nicolas Roarde46990e2009-06-19 16:27:49 +0100131 public void setIcon(Bitmap icon) {
132 mIcon = icon;
133 }
134
135 public Bitmap getIcon() {
136 return mIcon;
137 }
Steve Block1ad98cf2009-07-28 11:07:10 +0100138
139 public String getPrettyOrigin() {
140 return mTitle == null ? null : hideHttp(mOrigin);
141 }
142
143 public String getPrettyTitle() {
144 return mTitle == null ? hideHttp(mOrigin) : mTitle;
145 }
146
147 private String hideHttp(String str) {
148 Uri uri = Uri.parse(str);
149 return "http".equals(uri.getScheme()) ? str.substring(7) : str;
150 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100151 }
152
153 class SiteAdapter extends ArrayAdapter<Site>
154 implements AdapterView.OnItemClickListener {
155 private int mResource;
156 private LayoutInflater mInflater;
157 private Bitmap mDefaultIcon;
Nicolas Roardc5702322009-09-14 20:39:08 +0100158 private Bitmap mUsageEmptyIcon;
159 private Bitmap mUsageLowIcon;
160 private Bitmap mUsageMediumIcon;
161 private Bitmap mUsageHighIcon;
162 private Bitmap mLocationIcon;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100163 private Site mCurrentSite;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100164
165 public SiteAdapter(Context context, int rsc) {
166 super(context, rsc);
167 mResource = rsc;
168 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
169 mDefaultIcon = BitmapFactory.decodeResource(getResources(),
170 R.drawable.ic_launcher_shortcut_browser_bookmark);
Nicolas Roardc5702322009-09-14 20:39:08 +0100171 mUsageEmptyIcon = BitmapFactory.decodeResource(getResources(),
172 R.drawable.usage_empty);
173 mUsageLowIcon = BitmapFactory.decodeResource(getResources(),
174 R.drawable.usage_low);
175 mUsageMediumIcon = BitmapFactory.decodeResource(getResources(),
176 R.drawable.usage_medium);
177 mUsageHighIcon = BitmapFactory.decodeResource(getResources(),
178 R.drawable.usage_high);
179 mLocationIcon = BitmapFactory.decodeResource(getResources(),
180 R.drawable.location);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100181 populateOrigins();
182 }
183
Steve Block089ce3a2009-07-29 17:16:01 +0100184 /**
185 * Adds the specified feature to the site corresponding to supplied
186 * origin in the map. Creates the site if it does not already exist.
187 */
188 private void addFeatureToSite(Map sites, String origin, int feature) {
189 Site site = null;
190 if (sites.containsKey(origin)) {
191 site = (Site) sites.get(origin);
192 } else {
193 site = new Site(origin);
194 sites.put(origin, site);
195 }
196 site.addFeature(feature);
197 }
198
Nicolas Roarde46990e2009-06-19 16:27:49 +0100199 public void populateOrigins() {
200 clear();
201
Steve Block089ce3a2009-07-29 17:16:01 +0100202 // Get the list of origins we want to display.
203 // All 'HTML 5 modules' (Database, Geolocation etc) form these
204 // origin strings using WebCore::SecurityOrigin::toString(), so it's
205 // safe to group origins here. Note that WebCore::SecurityOrigin
206 // uses 0 (which is not printed) for the port if the port is the
207 // default for the protocol. Eg http://www.google.com and
208 // http://www.google.com:80 both record a port of 0 and hence
209 // toString() == 'http://www.google.com' for both.
Andrei Popescu824faeb2009-07-21 18:24:06 +0100210 Set origins = WebStorage.getInstance().getOrigins();
Steve Block089ce3a2009-07-29 17:16:01 +0100211 Map sites = new HashMap<String, Site>();
Nicolas Roarde46990e2009-06-19 16:27:49 +0100212 if (origins != null) {
Andrei Popescu824faeb2009-07-21 18:24:06 +0100213 Iterator<String> iter = origins.iterator();
214 while (iter.hasNext()) {
Steve Block089ce3a2009-07-29 17:16:01 +0100215 addFeatureToSite(sites, iter.next(), Site.FEATURE_WEB_STORAGE);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100216 }
217 }
Steve Blockf344d032009-07-30 10:50:45 +0100218 origins = GeolocationPermissions.getInstance().getOrigins();
219 if (origins != null) {
220 Iterator<String> iter = origins.iterator();
221 while (iter.hasNext()) {
222 addFeatureToSite(sites, iter.next(), Site.FEATURE_GEOLOCATION);
223 }
224 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100225
Steve Blockee0d6392009-07-28 13:49:15 +0100226 // Create a map from host to origin. This is used to add metadata
227 // (title, icon) for this origin from the bookmarks DB.
228 HashMap hosts = new HashMap<String, Set<Site> >();
Steve Block089ce3a2009-07-29 17:16:01 +0100229 Set keys = sites.keySet();
230 Iterator<String> originIter = keys.iterator();
231 while (originIter.hasNext()) {
232 String origin = originIter.next();
233 Site site = (Site) sites.get(origin);
234 String host = Uri.parse(origin).getHost();
Steve Blockee0d6392009-07-28 13:49:15 +0100235 Set hostSites = null;
236 if (hosts.containsKey(host)) {
237 hostSites = (Set) hosts.get(host);
238 } else {
239 hostSites = new HashSet<Site>();
240 hosts.put(host, hostSites);
241 }
242 hostSites.add(site);
243 }
244
245 // Check the bookmark DB. If we have data for a host used by any of
246 // our origins, use it to set their title and favicon
Nicolas Roarde46990e2009-06-19 16:27:49 +0100247 Cursor c = getContext().getContentResolver().query(Browser.BOOKMARKS_URI,
248 new String[] { Browser.BookmarkColumns.URL, Browser.BookmarkColumns.TITLE,
249 Browser.BookmarkColumns.FAVICON }, "bookmark = 1", null, null);
250
251 if ((c != null) && c.moveToFirst()) {
252 int urlIndex = c.getColumnIndex(Browser.BookmarkColumns.URL);
253 int titleIndex = c.getColumnIndex(Browser.BookmarkColumns.TITLE);
254 int faviconIndex = c.getColumnIndex(Browser.BookmarkColumns.FAVICON);
255 do {
256 String url = c.getString(urlIndex);
257 String host = Uri.parse(url).getHost();
Steve Blockee0d6392009-07-28 13:49:15 +0100258 if (hosts.containsKey(host)) {
Nicolas Roarde46990e2009-06-19 16:27:49 +0100259 String title = c.getString(titleIndex);
Steve Blockee0d6392009-07-28 13:49:15 +0100260 Bitmap bmp = null;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100261 byte[] data = c.getBlob(faviconIndex);
262 if (data != null) {
Steve Blockee0d6392009-07-28 13:49:15 +0100263 bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
264 }
265 Set matchingSites = (Set) hosts.get(host);
Steve Block089ce3a2009-07-29 17:16:01 +0100266 Iterator<Site> sitesIter = matchingSites.iterator();
Steve Blockee0d6392009-07-28 13:49:15 +0100267 while (sitesIter.hasNext()) {
268 Site site = sitesIter.next();
269 site.setTitle(title);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100270 if (bmp != null) {
271 site.setIcon(bmp);
272 }
273 }
274 }
275 } while (c.moveToNext());
276 }
277
278 // We can now simply populate our array with Site instances
Steve Block089ce3a2009-07-29 17:16:01 +0100279 keys = sites.keySet();
280 originIter = keys.iterator();
281 while (originIter.hasNext()) {
282 String origin = originIter.next();
283 Site site = (Site) sites.get(origin);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100284 add(site);
285 }
286
287 if (getCount() == 0) {
288 finish(); // we close the screen
289 }
290 }
291
292 public int getCount() {
293 if (mCurrentSite == null) {
294 return super.getCount();
295 }
Steve Block089ce3a2009-07-29 17:16:01 +0100296 return mCurrentSite.getFeatureCount();
Nicolas Roarde46990e2009-06-19 16:27:49 +0100297 }
298
Steve Block764f0c92009-09-10 15:01:37 +0100299 public String sizeValueToString(long bytes) {
300 // We display the size in MB, to 1dp, rounding up to the next 0.1MB.
301 // bytes should always be greater than zero.
302 if (bytes <= 0) {
303 Log.e(LOGTAG, "sizeValueToString called with non-positive value");
Nicolas Roarde46990e2009-06-19 16:27:49 +0100304 return "0";
305 }
Steve Block764f0c92009-09-10 15:01:37 +0100306 float megabytes = (float) bytes / (1024.0F * 1024.0F);
307 int truncated = (int) Math.ceil(megabytes * 10.0F);
308 float result = (float) (truncated / 10.0F);
309 return String.valueOf(result);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100310 }
311
312 /*
313 * If we receive the back event and are displaying
314 * site's settings, we want to go back to the main
315 * list view. If not, we just do nothing (see
316 * dispatchKeyEvent() below).
317 */
318 public boolean backKeyPressed() {
319 if (mCurrentSite != null) {
320 mCurrentSite = null;
321 populateOrigins();
322 notifyDataSetChanged();
323 return true;
324 }
325 return false;
326 }
327
328 public View getView(int position, View convertView, ViewGroup parent) {
329 View view;
330 TextView title;
331 TextView subtitle;
332 ImageView icon;
Nicolas Roardc5702322009-09-14 20:39:08 +0100333 ImageView usageIcon;
334 ImageView locationIcon;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100335
336 if (convertView == null) {
337 view = mInflater.inflate(mResource, parent, false);
338 } else {
339 view = convertView;
340 }
341
342 title = (TextView) view.findViewById(R.id.title);
343 subtitle = (TextView) view.findViewById(R.id.subtitle);
344 icon = (ImageView) view.findViewById(R.id.icon);
Nicolas Roardc5702322009-09-14 20:39:08 +0100345 usageIcon = (ImageView) view.findViewById(R.id.usage_icon);
346 locationIcon = (ImageView) view.findViewById(R.id.location_icon);
347 usageIcon.setVisibility(View.GONE);
348 locationIcon.setVisibility(View.GONE);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100349
350 if (mCurrentSite == null) {
Steve Block4d055a52009-07-31 08:38:58 +0100351 setTitle(getString(R.string.pref_extras_website_settings));
352
Nicolas Roarde46990e2009-06-19 16:27:49 +0100353 Site site = getItem(position);
Steve Block1ad98cf2009-07-28 11:07:10 +0100354 title.setText(site.getPrettyTitle());
355 subtitle.setText(site.getPrettyOrigin());
Nicolas Roarde46990e2009-06-19 16:27:49 +0100356 icon.setVisibility(View.VISIBLE);
Nicolas Roardc5702322009-09-14 20:39:08 +0100357 usageIcon.setVisibility(View.INVISIBLE);
358 locationIcon.setVisibility(View.INVISIBLE);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100359 Bitmap bmp = site.getIcon();
360 if (bmp == null) {
361 bmp = mDefaultIcon;
362 }
363 icon.setImageBitmap(bmp);
364 // We set the site as the view's tag,
365 // so that we can get it in onItemClick()
366 view.setTag(site);
Nicolas Roardc5702322009-09-14 20:39:08 +0100367
368 if (site.hasFeature(Site.FEATURE_WEB_STORAGE)) {
369 String origin = site.getOrigin();
370 long usageInBytes = WebStorage.getInstance().getUsageForOrigin(origin);
371 float usageInMegabytes = (float) usageInBytes / (1024.0F * 1024.0F);
372 usageIcon.setVisibility(View.VISIBLE);
373
374 // We set the correct icon:
375 // 0 < empty < 0.1MB
376 // 0.1MB < low < 3MB
377 // 3MB < medium < 6MB
378 // 6MB < high
379 if (usageInMegabytes <= 0.1) {
380 usageIcon.setImageBitmap(mUsageEmptyIcon);
381 } else if (usageInMegabytes > 0.1 && usageInMegabytes <= 3) {
382 usageIcon.setImageBitmap(mUsageLowIcon);
383 } else if (usageInMegabytes > 3 && usageInMegabytes <= 6) {
384 usageIcon.setImageBitmap(mUsageMediumIcon);
385 } else if (usageInMegabytes > 6) {
386 usageIcon.setImageBitmap(mUsageHighIcon);
387 }
388 }
389
390 if (site.hasFeature(Site.FEATURE_GEOLOCATION)) {
391 locationIcon.setVisibility(View.VISIBLE);
392 locationIcon.setImageBitmap(mLocationIcon);
393 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100394 } else {
Steve Block4d055a52009-07-31 08:38:58 +0100395 setTitle(mCurrentSite.getPrettyTitle());
Nicolas Roarde46990e2009-06-19 16:27:49 +0100396 icon.setVisibility(View.GONE);
Steve Block089ce3a2009-07-29 17:16:01 +0100397 String origin = mCurrentSite.getOrigin();
398 switch (mCurrentSite.getFeatureByIndex(position)) {
399 case Site.FEATURE_WEB_STORAGE:
400 long usageValue = WebStorage.getInstance().getUsageForOrigin(origin);
401 String usage = sizeValueToString(usageValue) + " " + sMBStored;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100402
Steve Block089ce3a2009-07-29 17:16:01 +0100403 title.setText(R.string.webstorage_clear_data_title);
404 subtitle.setText(usage);
405 break;
Steve Blockf344d032009-07-30 10:50:45 +0100406 case Site.FEATURE_GEOLOCATION:
407 title.setText(R.string.geolocation_settings_page_title);
408 boolean allowed = GeolocationPermissions.getInstance().getAllowed(origin);
409 subtitle.setText(allowed ?
410 R.string.geolocation_settings_page_summary_allowed :
411 R.string.geolocation_settings_page_summary_not_allowed);
412 break;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100413 }
414 }
415
416 return view;
417 }
418
419 public void onItemClick(AdapterView<?> parent,
420 View view,
421 int position,
422 long id) {
423 if (mCurrentSite != null) {
Steve Block089ce3a2009-07-29 17:16:01 +0100424 switch (mCurrentSite.getFeatureByIndex(position)) {
425 case Site.FEATURE_WEB_STORAGE:
426 new AlertDialog.Builder(getContext())
427 .setTitle(R.string.webstorage_clear_data_dialog_title)
428 .setMessage(R.string.webstorage_clear_data_dialog_message)
429 .setPositiveButton(R.string.webstorage_clear_data_dialog_ok_button,
430 new AlertDialog.OnClickListener() {
431 public void onClick(DialogInterface dlg, int which) {
432 WebStorage.getInstance().deleteOrigin(mCurrentSite.getOrigin());
433 mCurrentSite = null;
434 populateOrigins();
435 notifyDataSetChanged();
436 }})
437 .setNegativeButton(R.string.webstorage_clear_data_dialog_cancel_button, null)
438 .setIcon(android.R.drawable.ic_dialog_alert)
439 .show();
440 break;
Steve Blockf344d032009-07-30 10:50:45 +0100441 case Site.FEATURE_GEOLOCATION:
442 new AlertDialog.Builder(getContext())
443 .setTitle(R.string.geolocation_settings_page_dialog_title)
444 .setMessage(R.string.geolocation_settings_page_dialog_message)
445 .setPositiveButton(R.string.geolocation_settings_page_dialog_ok_button,
446 new AlertDialog.OnClickListener() {
447 public void onClick(DialogInterface dlg, int which) {
448 GeolocationPermissions.getInstance().clear(mCurrentSite.getOrigin());
449 mCurrentSite = null;
450 populateOrigins();
451 notifyDataSetChanged();
452 }})
453 .setNegativeButton(R.string.geolocation_settings_page_dialog_cancel_button, null)
454 .setIcon(android.R.drawable.ic_dialog_alert)
455 .show();
456 break;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100457 }
458 } else {
459 mCurrentSite = (Site) view.getTag();
460 notifyDataSetChanged();
461 }
462 }
463 }
464
465 /**
466 * Intercepts the back key to immediately notify
467 * NativeDialog that we are done.
468 */
469 public boolean dispatchKeyEvent(KeyEvent event) {
470 if ((event.getKeyCode() == KeyEvent.KEYCODE_BACK)
471 && (event.getAction() == KeyEvent.ACTION_DOWN)) {
472 if ((mAdapter != null) && (mAdapter.backKeyPressed())){
473 return true; // event consumed
474 }
475 }
476 return super.dispatchKeyEvent(event);
477 }
478
479 @Override
480 protected void onCreate(Bundle icicle) {
481 super.onCreate(icicle);
482 if (sMBStored == null) {
483 sMBStored = getString(R.string.webstorage_origin_summary_mb_stored);
484 }
Nicolas Roardc5702322009-09-14 20:39:08 +0100485 mAdapter = new SiteAdapter(this, R.layout.website_settings_row);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100486 setListAdapter(mAdapter);
487 getListView().setOnItemClickListener(mAdapter);
488 }
Ben Murdochb9daacb2009-09-14 10:48:24 +0100489
490 @Override
491 public boolean onCreateOptionsMenu(Menu menu) {
492 MenuInflater inflater = getMenuInflater();
493 inflater.inflate(R.menu.websitesettings, menu);
494 return true;
495 }
496
497 @Override
498 public boolean onPrepareOptionsMenu(Menu menu) {
499 // If we aren't listing any sites hide the clear all button (and hence the menu).
500 return mAdapter.getCount() > 0;
501 }
502
503 @Override
504 public boolean onOptionsItemSelected(MenuItem item) {
505 switch (item.getItemId()) {
506 case R.id.website_settings_menu_clear_all:
507 // Show the prompt to clear all origins of their data and geolocation permissions.
508 new AlertDialog.Builder(this)
509 .setTitle(R.string.website_settings_clear_all_dialog_title)
510 .setMessage(R.string.website_settings_clear_all_dialog_message)
511 .setPositiveButton(R.string.website_settings_clear_all_dialog_ok_button,
512 new AlertDialog.OnClickListener() {
513 public void onClick(DialogInterface dlg, int which) {
514 WebStorage.getInstance().deleteAllData();
515 GeolocationPermissions.getInstance().clearAll();
516 mAdapter.populateOrigins();
517 mAdapter.notifyDataSetChanged();
518 }})
519 .setNegativeButton(R.string.website_settings_clear_all_dialog_cancel_button, null)
520 .setIcon(android.R.drawable.ic_dialog_alert)
521 .show();
522 return true;
523 }
524 return false;
525 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100526}