summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index c9111a9..b2ff5fc 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -240,6 +240,7 @@ Browser::Browser(Type type, Profile* profile)
encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector,
profile_->GetPrefs(), NULL);
use_vertical_tabs_.Init(prefs::kUseVerticalTabs, profile_->GetPrefs(), this);
+ instant_enabled_.Init(prefs::kInstantEnabled, profile_->GetPrefs(), this);
if (!TabMenuModel::AreVerticalTabsEnabled()) {
// If vertical tabs aren't enabled, explicitly turn them off. Otherwise we
// might show vertical tabs but not show an option to turn them off.
@@ -3350,6 +3351,15 @@ void Browser::Observe(NotificationType type,
UseVerticalTabsChanged();
} else if (pref_name == prefs::kPrintingEnabled) {
UpdatePrintingState(0);
+ } else if (pref_name == prefs::kInstantEnabled) {
+ if (!InstantController::IsEnabled(profile())) {
+ if (instant()) {
+ instant()->DestroyPreviewContents();
+ instant_.reset(NULL);
+ }
+ } else {
+ CreateInstantIfNecessary();
+ }
} else {
NOTREACHED();
}
@@ -4257,7 +4267,7 @@ bool Browser::OpenInstant(WindowOpenDisposition disposition) {
}
void Browser::CreateInstantIfNecessary() {
- if (type() == TYPE_NORMAL && InstantController::IsEnabled() &&
+ if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) &&
!profile()->IsOffTheRecord()) {
instant_.reset(new InstantController(this));
}