diff options
-rw-r--r-- | src/com/android/browser/Browser.java | 1 | ||||
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 1 | ||||
-rw-r--r-- | src/com/android/browser/BrowserSettings.java | 19 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java index 524f789..7822ec8 100644 --- a/src/com/android/browser/Browser.java +++ b/src/com/android/browser/Browser.java @@ -57,6 +57,7 @@ public class Browser extends Application { CookieSyncManager.createInstance(this); // remove all expired cookies CookieManager.getInstance().removeExpiredCookie(); + BrowserSettings.getInstance().loadFromDb(this); } static Intent createBrowserViewIntent() { diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 1903713..2f4f39a 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -301,7 +301,6 @@ public class BrowserActivity extends Activity // Keep a settings instance handy. mSettings = BrowserSettings.getInstance(); mSettings.setTabControl(mTabControl); - mSettings.loadFromDb(this); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser"); diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index 81f1d72..2cbfa29 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -223,9 +223,7 @@ class BrowserSettings extends Observable { s.setDatabasePath(b.databasePath); s.setGeolocationDatabasePath(b.geolocationDatabasePath); - // Enable/Disable the error console. - b.mTabControl.getBrowserActivity().setShouldShowErrorConsole( - b.showDebugSettings && b.showConsole); + b.updateTabControlSettings(); } } @@ -310,9 +308,6 @@ class BrowserSettings extends Observable { p.getBoolean("landscape_only", landscapeOnly); if (landscapeOnlyTemp != landscapeOnly) { landscapeOnly = landscapeOnlyTemp; - mTabControl.getBrowserActivity().setRequestedOrientation( - landscapeOnly ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE - : ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } useWideViewPort = true; // use wide view port for either setting if (autoFitPage) { @@ -359,8 +354,6 @@ class BrowserSettings extends Observable { // regardless of the setting we read here. This setting is only used after debug // is enabled. showConsole = p.getBoolean("javascript_console", showConsole); - mTabControl.getBrowserActivity().setShouldShowErrorConsole( - showDebugSettings && showConsole); // HTML5 API flags appCacheEnabled = p.getBoolean("enable_appcache", appCacheEnabled); @@ -488,6 +481,7 @@ class BrowserSettings extends Observable { */ /* package */void setTabControl(TabControl tabControl) { mTabControl = tabControl; + updateTabControlSettings(); } /* @@ -531,6 +525,15 @@ class BrowserSettings extends Observable { db.clearHttpAuthUsernamePassword(); } + private void updateTabControlSettings() { + // Enable/disable the error console. + mTabControl.getBrowserActivity().setShouldShowErrorConsole( + showDebugSettings && showConsole); + mTabControl.getBrowserActivity().setRequestedOrientation( + landscapeOnly ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + : ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } + private void maybeDisableWebsiteSettings(Context context) { PreferenceActivity activity = (PreferenceActivity) context; final PreferenceScreen screen = (PreferenceScreen) |