summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Tab.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-04-25 09:01:54 -0700
committerJohn Reck <jreck@google.com>2011-04-26 13:03:32 -0700
commit35e9dd6283a2d65687104eb0b3a459c02dcb150b (patch)
treed7091a875a205b2650106d8d01331f30eeb7e68a /src/com/android/browser/Tab.java
parent6cd8f6b6ad2733f71d81de1188d830d010c1b4b6 (diff)
downloadpackages_apps_Browser-35e9dd6283a2d65687104eb0b3a459c02dcb150b.zip
packages_apps_Browser-35e9dd6283a2d65687104eb0b3a459c02dcb150b.tar.gz
packages_apps_Browser-35e9dd6283a2d65687104eb0b3a459c02dcb150b.tar.bz2
Browser settings refactor
Change-Id: I6fc1b21f7ea692fbe37a17bf900e9b7408a9c077
Diffstat (limited to 'src/com/android/browser/Tab.java')
-rw-r--r--src/com/android/browser/Tab.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 8368c33..3508005 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -139,6 +139,7 @@ class Tab {
DownloadTouchIcon mTouchIconLoader;
private Bitmap mScreenshot;
+ private BrowserSettings mSettings;
// All the state needed for a page
private static class PageState {
@@ -711,7 +712,7 @@ class Tab {
setLockIconType(LockIcon.LOCK_ICON_UNSECURE);
return;
}
- if (BrowserSettings.getInstance().showSecurityWarnings()) {
+ if (mSettings.showSecurityWarnings()) {
final LayoutInflater factory =
LayoutInflater.from(mActivity);
final View warningsView =
@@ -1017,7 +1018,7 @@ class Tab {
public void onExceededDatabaseQuota(String url,
String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) {
- BrowserSettings.getInstance().getWebStorageSizeManager()
+ mSettings.getWebStorageSizeManager()
.onExceededDatabaseQuota(url, databaseIdentifier,
currentQuota, estimatedSize, totalUsedQuota,
quotaUpdater);
@@ -1036,7 +1037,7 @@ class Tab {
@Override
public void onReachedMaxAppCacheSize(long spaceNeeded,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) {
- BrowserSettings.getInstance().getWebStorageSizeManager()
+ mSettings.getWebStorageSizeManager()
.onReachedMaxAppCacheSize(spaceNeeded, totalUsedQuota,
quotaUpdater);
}
@@ -1174,10 +1175,7 @@ class Tab {
if (disableAutoFill.isChecked()) {
// Disable autofill and show a toast with how to turn it on again.
- BrowserSettings s = BrowserSettings.getInstance();
- s.addObserver(mMainView.getSettings());
- s.disableAutoFill(mActivity);
- s.update();
+ mSettings.setAutofillEnabled(false);
Toast.makeText(mActivity,
R.string.autofill_setup_dialog_negative_toast,
Toast.LENGTH_LONG).show();
@@ -1296,6 +1294,7 @@ class Tab {
String url) {
mWebViewController = wvcontroller;
mActivity = mWebViewController.getActivity();
+ mSettings = BrowserSettings.getInstance();
mCloseOnExit = closeOnExit;
mAppId = appId;
mDataController = DataController.getInstance(mActivity);
@@ -1369,7 +1368,6 @@ class Tab {
void destroy() {
if (mMainView != null) {
dismissSubWindow();
- BrowserSettings.getInstance().deleteObserver(mMainView.getSettings());
// save the WebView to call destroy() after detach it from the tab
WebView webView = mMainView;
setWebView(null);
@@ -1431,8 +1429,6 @@ class Tab {
void dismissSubWindow() {
if (mSubView != null) {
mWebViewController.endActionMode();
- BrowserSettings.getInstance().deleteObserver(
- mSubView.getSettings());
mSubView.destroy();
mSubView = null;
mSubViewContainer = null;