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

Unified Diff: chrome/browser/instant/search.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: rebased, resolved conflicts 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/instant/search.cc
diff --git a/chrome/browser/instant/search.cc b/chrome/browser/instant/search.cc
index 2816d5250fcd482487b0feb49968e12830d62cdf..9a1c34715b288ba1075611337a894689ce5153f3 100644
--- a/chrome/browser/instant/search.cc
+++ b/chrome/browser/instant/search.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/search_types.h"
#include "chrome/common/url_constants.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/navigation_entry.h"
@@ -522,5 +523,16 @@ GURL CoerceCommandLineURLToTemplateURL(const GURL& instant_url,
return instant_url.ReplaceComponents(replacements);
}
+bool ShouldHandleTopBarsVisibilityChange(const Mode& old_mode,
+ const Mode& new_mode) {
+ // If mode has changed, only handle top bars visibility change if new mode
+ // is not |SEARCH_SUGGESTIONS| or |SEARCH_RESULTS|. Top bars visibility for
+ // these 2 modes is determined when the mode stays the same, and:
+ // - for |NTP/SERP| pages: by SearchBox API, or
+ // - for |DEFAULT| pages: by platform-specific implementation of
+ // |InstantOverlayController| when it shows/hides the Instant overlay.
+ return old_mode != new_mode ? !new_mode.is_search() : new_mode.is_search();
+}
+
} // namespace search
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698