summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-17 03:23:25 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-17 03:23:25 +0000
commit73de26a684944782a92f8e6840e1b290c9a424cd (patch)
treeec40aeeb6615acf4d0c022d05637bb136da39b80 /chrome/browser/browser.cc
parentd7e1eb01337e621b6c23e8f3af0d7728a83d78d8 (diff)
downloadchromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.zip
chromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.tar.gz
chromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.tar.bz2
Revert 62881 - Moves instant back into flags.
I'm TBRing this since it's mostly a revert. TBR=ben@chromium.org BUG=59298 TEST=make sure instant isn't in preferences anymore. Review URL: http://codereview.chromium.org/3809005 TBR=sky@chromium.org Review URL: http://codereview.chromium.org/3777009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62883 0039d316-1c4b-4281-b951-d872f2087c98
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));
}