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

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: profile keyed 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..52e8ac1895e017f24481dfc2ae382ed6e41560a5 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::GetInstance(browser_->profile(), this) :
+ NULL);
+ instant_unload_handler_.reset(instant() ? new InstantUnloadHandler(browser_) :
+ NULL);
}
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698