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

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

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ae24c8abdb62a14bc6c738f68de3ac250f9b6727..7718abc15b4d1ec8a41d5d53d4f97fd89b3f4f2e 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -59,6 +59,7 @@
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/google/google_url_tracker.h"
+#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/search.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/net/url_fixer_upper.h"
@@ -1007,7 +1008,7 @@ void Browser::TabDeactivated(WebContents* contents) {
window_->GetLocationBar()->SaveStateToContents(contents);
if (instant_controller_)
- instant_controller_->TabDeactivated(contents);
+ instant_controller_->instant()->TabDeactivated(contents);
samarth 2013/03/11 19:03:24 I always found the fact that BrowserInstantControl
}
void Browser::ActiveTabChanged(WebContents* old_contents,
@@ -1079,7 +1080,7 @@ void Browser::ActiveTabChanged(WebContents* old_contents,
// This needs to be called after UpdateSearchState().
if (instant_controller_)
- instant_controller_->ActiveTabChanged();
+ instant_controller_->instant()->ActiveTabChanged();
}
void Browser::TabMoved(WebContents* contents,
@@ -1223,18 +1224,15 @@ void Browser::ShowFirstRunBubble() {
window()->GetLocationBar()->ShowFirstRunBubble();
}
-void Browser::MaybeUpdateBookmarkBarStateForInstantOverlay(
- const chrome::search::Mode& mode) {
+void Browser::MaybeUpdateBookmarkBarStateForInstantOverlay() {
// This is invoked by a platform-specific implementation of
// |InstantOverlayController| to update bookmark bar state according to
// Instant overlay state.
// ModeChanged() updates bookmark bar state for all mode transitions except
// when new mode is |SEARCH_SUGGESTIONS|, because that needs to be done when
// the suggestions are ready.
- if (mode.is_search_suggestions() &&
- bookmark_bar_state_ == BookmarkBar::SHOW) {
+ if (bookmark_bar_state_ == BookmarkBar::SHOW)
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
- }
}
void Browser::ShowDownload(content::DownloadItem* download) {
@@ -1826,6 +1824,9 @@ void Browser::ModeChanged(const chrome::search::Mode& old_mode,
return;
}
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
+
+ if (instant_controller_)
+ instant_controller_->instant()->SearchModeChanged(old_mode, new_mode);
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698