blob: 640a32d7fb0fcf17a03552548684807383b47faf [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
Nicolas Roardd95fb212009-09-17 16:56:27 +0100278 c.close();
279
Nicolas Roarde46990e2009-06-19 16:27:49 +0100280 // We can now simply populate our array with Site instances
Steve Block089ce3a2009-07-29 17:16:01 +0100281 keys = sites.keySet();
282 originIter = keys.iterator();
283 while (originIter.hasNext()) {
284 String origin = originIter.next();
285 Site site = (Site) sites.get(origin);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100286 add(site);
287 }
288
289 if (getCount() == 0) {
290 finish(); // we close the screen
291 }
292 }
293
294 public int getCount() {
295 if (mCurrentSite == null) {
296 return super.getCount();
297 }
Steve Block089ce3a2009-07-29 17:16:01 +0100298 return mCurrentSite.getFeatureCount();
Nicolas Roarde46990e2009-06-19 16:27:49 +0100299 }
300
Steve Block764f0c92009-09-10 15:01:37 +0100301 public String sizeValueToString(long bytes) {
302 // We display the size in MB, to 1dp, rounding up to the next 0.1MB.
303 // bytes should always be greater than zero.
304 if (bytes <= 0) {
305 Log.e(LOGTAG, "sizeValueToString called with non-positive value");
Nicolas Roarde46990e2009-06-19 16:27:49 +0100306 return "0";
307 }
Steve Block764f0c92009-09-10 15:01:37 +0100308 float megabytes = (float) bytes / (1024.0F * 1024.0F);
309 int truncated = (int) Math.ceil(megabytes * 10.0F);
310 float result = (float) (truncated / 10.0F);
311 return String.valueOf(result);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100312 }
313
314 /*
315 * If we receive the back event and are displaying
316 * site's settings, we want to go back to the main
317 * list view. If not, we just do nothing (see
318 * dispatchKeyEvent() below).
319 */
320 public boolean backKeyPressed() {
321 if (mCurrentSite != null) {
322 mCurrentSite = null;
323 populateOrigins();
324 notifyDataSetChanged();
325 return true;
326 }
327 return false;
328 }
329
330 public View getView(int position, View convertView, ViewGroup parent) {
331 View view;
332 TextView title;
333 TextView subtitle;
334 ImageView icon;
Nicolas Roardc5702322009-09-14 20:39:08 +0100335 ImageView usageIcon;
336 ImageView locationIcon;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100337
338 if (convertView == null) {
339 view = mInflater.inflate(mResource, parent, false);
340 } else {
341 view = convertView;
342 }
343
344 title = (TextView) view.findViewById(R.id.title);
345 subtitle = (TextView) view.findViewById(R.id.subtitle);
346 icon = (ImageView) view.findViewById(R.id.icon);
Nicolas Roardc5702322009-09-14 20:39:08 +0100347 usageIcon = (ImageView) view.findViewById(R.id.usage_icon);
348 locationIcon = (ImageView) view.findViewById(R.id.location_icon);
349 usageIcon.setVisibility(View.GONE);
350 locationIcon.setVisibility(View.GONE);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100351
352 if (mCurrentSite == null) {
Steve Block4d055a52009-07-31 08:38:58 +0100353 setTitle(getString(R.string.pref_extras_website_settings));
354
Nicolas Roarde46990e2009-06-19 16:27:49 +0100355 Site site = getItem(position);
Steve Block1ad98cf2009-07-28 11:07:10 +0100356 title.setText(site.getPrettyTitle());
357 subtitle.setText(site.getPrettyOrigin());
Nicolas Roarde46990e2009-06-19 16:27:49 +0100358 icon.setVisibility(View.VISIBLE);
Nicolas Roardc5702322009-09-14 20:39:08 +0100359 usageIcon.setVisibility(View.INVISIBLE);
360 locationIcon.setVisibility(View.INVISIBLE);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100361 Bitmap bmp = site.getIcon();
362 if (bmp == null) {
363 bmp = mDefaultIcon;
364 }
365 icon.setImageBitmap(bmp);
366 // We set the site as the view's tag,
367 // so that we can get it in onItemClick()
368 view.setTag(site);
Nicolas Roardc5702322009-09-14 20:39:08 +0100369
370 if (site.hasFeature(Site.FEATURE_WEB_STORAGE)) {
371 String origin = site.getOrigin();
372 long usageInBytes = WebStorage.getInstance().getUsageForOrigin(origin);
373 float usageInMegabytes = (float) usageInBytes / (1024.0F * 1024.0F);
374 usageIcon.setVisibility(View.VISIBLE);
375
376 // We set the correct icon:
377 // 0 < empty < 0.1MB
378 // 0.1MB < low < 3MB
379 // 3MB < medium < 6MB
380 // 6MB < high
381 if (usageInMegabytes <= 0.1) {
382 usageIcon.setImageBitmap(mUsageEmptyIcon);
383 } else if (usageInMegabytes > 0.1 && usageInMegabytes <= 3) {
384 usageIcon.setImageBitmap(mUsageLowIcon);
385 } else if (usageInMegabytes > 3 && usageInMegabytes <= 6) {
386 usageIcon.setImageBitmap(mUsageMediumIcon);
387 } else if (usageInMegabytes > 6) {
388 usageIcon.setImageBitmap(mUsageHighIcon);
389 }
390 }
391
392 if (site.hasFeature(Site.FEATURE_GEOLOCATION)) {
393 locationIcon.setVisibility(View.VISIBLE);
394 locationIcon.setImageBitmap(mLocationIcon);
395 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100396 } else {
Steve Block4d055a52009-07-31 08:38:58 +0100397 setTitle(mCurrentSite.getPrettyTitle());
Nicolas Roarde46990e2009-06-19 16:27:49 +0100398 icon.setVisibility(View.GONE);
Steve Block089ce3a2009-07-29 17:16:01 +0100399 String origin = mCurrentSite.getOrigin();
400 switch (mCurrentSite.getFeatureByIndex(position)) {
401 case Site.FEATURE_WEB_STORAGE:
402 long usageValue = WebStorage.getInstance().getUsageForOrigin(origin);
403 String usage = sizeValueToString(usageValue) + " " + sMBStored;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100404
Steve Block089ce3a2009-07-29 17:16:01 +0100405 title.setText(R.string.webstorage_clear_data_title);
406 subtitle.setText(usage);
407 break;
Steve Blockf344d032009-07-30 10:50:45 +0100408 case Site.FEATURE_GEOLOCATION:
409 title.setText(R.string.geolocation_settings_page_title);
410 boolean allowed = GeolocationPermissions.getInstance().getAllowed(origin);
411 subtitle.setText(allowed ?
412 R.string.geolocation_settings_page_summary_allowed :
413 R.string.geolocation_settings_page_summary_not_allowed);
414 break;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100415 }
416 }
417
418 return view;
419 }
420
421 public void onItemClick(AdapterView<?> parent,
422 View view,
423 int position,
424 long id) {
425 if (mCurrentSite != null) {
Steve Block089ce3a2009-07-29 17:16:01 +0100426 switch (mCurrentSite.getFeatureByIndex(position)) {
427 case Site.FEATURE_WEB_STORAGE:
428 new AlertDialog.Builder(getContext())
429 .setTitle(R.string.webstorage_clear_data_dialog_title)
430 .setMessage(R.string.webstorage_clear_data_dialog_message)
431 .setPositiveButton(R.string.webstorage_clear_data_dialog_ok_button,
432 new AlertDialog.OnClickListener() {
433 public void onClick(DialogInterface dlg, int which) {
434 WebStorage.getInstance().deleteOrigin(mCurrentSite.getOrigin());
435 mCurrentSite = null;
436 populateOrigins();
437 notifyDataSetChanged();
438 }})
439 .setNegativeButton(R.string.webstorage_clear_data_dialog_cancel_button, null)
440 .setIcon(android.R.drawable.ic_dialog_alert)
441 .show();
442 break;
Steve Blockf344d032009-07-30 10:50:45 +0100443 case Site.FEATURE_GEOLOCATION:
444 new AlertDialog.Builder(getContext())
445 .setTitle(R.string.geolocation_settings_page_dialog_title)
446 .setMessage(R.string.geolocation_settings_page_dialog_message)
447 .setPositiveButton(R.string.geolocation_settings_page_dialog_ok_button,
448 new AlertDialog.OnClickListener() {
449 public void onClick(DialogInterface dlg, int which) {
450 GeolocationPermissions.getInstance().clear(mCurrentSite.getOrigin());
451 mCurrentSite = null;
452 populateOrigins();
453 notifyDataSetChanged();
454 }})
455 .setNegativeButton(R.string.geolocation_settings_page_dialog_cancel_button, null)
456 .setIcon(android.R.drawable.ic_dialog_alert)
457 .show();
458 break;
Nicolas Roarde46990e2009-06-19 16:27:49 +0100459 }
460 } else {
461 mCurrentSite = (Site) view.getTag();
462 notifyDataSetChanged();
463 }
464 }
465 }
466
467 /**
468 * Intercepts the back key to immediately notify
469 * NativeDialog that we are done.
470 */
471 public boolean dispatchKeyEvent(KeyEvent event) {
472 if ((event.getKeyCode() == KeyEvent.KEYCODE_BACK)
473 && (event.getAction() == KeyEvent.ACTION_DOWN)) {
474 if ((mAdapter != null) && (mAdapter.backKeyPressed())){
475 return true; // event consumed
476 }
477 }
478 return super.dispatchKeyEvent(event);
479 }
480
481 @Override
482 protected void onCreate(Bundle icicle) {
483 super.onCreate(icicle);
484 if (sMBStored == null) {
485 sMBStored = getString(R.string.webstorage_origin_summary_mb_stored);
486 }
Nicolas Roardc5702322009-09-14 20:39:08 +0100487 mAdapter = new SiteAdapter(this, R.layout.website_settings_row);
Nicolas Roarde46990e2009-06-19 16:27:49 +0100488 setListAdapter(mAdapter);
489 getListView().setOnItemClickListener(mAdapter);
490 }
Ben Murdochb9daacb2009-09-14 10:48:24 +0100491
492 @Override
493 public boolean onCreateOptionsMenu(Menu menu) {
494 MenuInflater inflater = getMenuInflater();
495 inflater.inflate(R.menu.websitesettings, menu);
496 return true;
497 }
498
499 @Override
500 public boolean onPrepareOptionsMenu(Menu menu) {
501 // If we aren't listing any sites hide the clear all button (and hence the menu).
502 return mAdapter.getCount() > 0;
503 }
504
505 @Override
506 public boolean onOptionsItemSelected(MenuItem item) {
507 switch (item.getItemId()) {
508 case R.id.website_settings_menu_clear_all:
509 // Show the prompt to clear all origins of their data and geolocation permissions.
510 new AlertDialog.Builder(this)
511 .setTitle(R.string.website_settings_clear_all_dialog_title)
512 .setMessage(R.string.website_settings_clear_all_dialog_message)
513 .setPositiveButton(R.string.website_settings_clear_all_dialog_ok_button,
514 new AlertDialog.OnClickListener() {
515 public void onClick(DialogInterface dlg, int which) {
516 WebStorage.getInstance().deleteAllData();
517 GeolocationPermissions.getInstance().clearAll();
518 mAdapter.populateOrigins();
519 mAdapter.notifyDataSetChanged();
520 }})
521 .setNegativeButton(R.string.website_settings_clear_all_dialog_cancel_button, null)
522 .setIcon(android.R.drawable.ic_dialog_alert)
523 .show();
524 return true;
525 }
526 return false;
527 }
Nicolas Roarde46990e2009-06-19 16:27:49 +0100528}