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

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

Issue 12631008: alternate ntp: implement Show/HideBars API to reduce jank when showing/hiding bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed flashing bars for DEFAULT->SUGGESTIONS->SERP 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_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 5ffb7f048551ff905f7e44d458e205b7f3f3f9ef..41b11589a7c3294ce31a9ad7fff2b9ed6e586dd7 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -236,8 +236,14 @@ void BrowserInstantController::ResetInstant(const std::string& pref_name) {
////////////////////////////////////////////////////////////////////////////////
// BrowserInstantController, search::SearchModelObserver implementation:
-void BrowserInstantController::ModeChanged(const search::Mode& old_mode,
- const search::Mode& new_mode) {
+void BrowserInstantController::ModelChanged(
+ const search::SearchModel::State& old_state,
+ const search::SearchModel::State& new_state) {
+ if (old_state.mode == new_state.mode)
+ return;
+
+ const search::Mode& new_mode = new_state.mode;
+
if (search::IsInstantExtendedAPIEnabled()) {
// Record some actions corresponding to the mode change. Note that to get
// the full story, it's necessary to look at other UMA actions as well,
@@ -252,7 +258,7 @@ void BrowserInstantController::ModeChanged(const search::Mode& old_mode,
if (new_mode.is_ntp())
UpdateThemeInfo();
- instant_.SearchModeChanged(old_mode, new_mode);
+ instant_.SearchModeChanged(old_state.mode, new_mode);
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698