| 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
|
|
|