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

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: renamed to CreateInstant; fixed ordering Created 8 years, 4 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
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..f0afc885130f658defbb67287942e879ba2b2869 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"
@@ -172,15 +171,15 @@ void BrowserInstantController::TabDeactivated(TabContents* contents) {
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_));
+ browser_->is_type_tabbed()) {
Peter Kasting 2012/08/31 01:51:19 Nit: No {} (2 places). Another option: Use "XXX ?
sreeram 2012/09/04 17:42:16 Done.
+ instant_.reset(InstantController::CreateInstant(browser_->profile(), this));
} else {
instant_.reset();
+ }
+
+ if (instant()) {
+ instant_unload_handler_.reset(new InstantUnloadHandler(browser_));
+ } else {
instant_unload_handler_.reset();
}
}

Powered by Google App Engine
This is Rietveld 408576698