Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 10879043: Centralize logic around Instant modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a few more style nits Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/search_engines/search_terms_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index d1213257908088bf8bfd24274f510f91bc4ebbd8..b4e46f5f088765b911aa5114487d2fe1a6e9726b 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
-#include "chrome/browser/ui/search/search.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
@@ -171,18 +170,12 @@ void BrowserInstantController::TabDeactivated(TabContents* contents) {
// BrowserInstantController, private:
void BrowserInstantController::ResetInstant() {
- if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
- InstantController::IsEnabled(browser_->profile()) &&
- browser_->is_type_tabbed() && !browser_->profile()->IsOffTheRecord()) {
- InstantController::Mode mode = InstantController::INSTANT;
- if (chrome::search::IsInstantExtendedAPIEnabled(browser_->profile()))
- mode = InstantController::EXTENDED;
- instant_.reset(new InstantController(this, mode));
- instant_unload_handler_.reset(new InstantUnloadHandler(browser_));
- } else {
- instant_.reset();
- instant_unload_handler_.reset();
- }
+ instant_.reset(
+ !browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
+ browser_->is_type_tabbed() ?
+ InstantController::CreateInstant(browser_->profile(), this) : NULL);
+ instant_unload_handler_.reset(instant() ?
+ new InstantUnloadHandler(browser_) : NULL);
}
} // namespace chrome
« no previous file with comments | « chrome/browser/search_engines/search_terms_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698