| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_ |
| 6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ | 6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // Returns the Local Instant URL of the New Tab Page. | 148 // Returns the Local Instant URL of the New Tab Page. |
| 149 // TODO(kmadhusu): Remove this function and update the call sites. | 149 // TODO(kmadhusu): Remove this function and update the call sites. |
| 150 GURL GetLocalInstantURL(Profile* profile); | 150 GURL GetLocalInstantURL(Profile* profile); |
| 151 | 151 |
| 152 // Returns true if 'hide_verbatim' flag is enabled in field trials | 152 // Returns true if 'hide_verbatim' flag is enabled in field trials |
| 153 // to hide the top match in the native suggestions dropdown if it is a verbatim | 153 // to hide the top match in the native suggestions dropdown if it is a verbatim |
| 154 // match. See comments on ShouldHideTopMatch in autocomplete_result.h. | 154 // match. See comments on ShouldHideTopMatch in autocomplete_result.h. |
| 155 bool ShouldHideTopVerbatimMatch(); | 155 bool ShouldHideTopVerbatimMatch(); |
| 156 | 156 |
| 157 // Returns true if the cacheable NTP should be shown and false if not. | |
| 158 // Exposed for testing. | |
| 159 bool ShouldUseCacheableNTP(); | |
| 160 | |
| 161 // Returns true if the Instant NTP should be shown and false if not. | |
| 162 bool ShouldShowInstantNTP(); | |
| 163 | |
| 164 // Returns when we should show a search button in the omnibox. This may be any | 157 // Returns when we should show a search button in the omnibox. This may be any |
| 165 // of several values, some of which depend on whether the underlying state of | 158 // of several values, some of which depend on whether the underlying state of |
| 166 // the page would normally be to perform search term replacement; see also | 159 // the page would normally be to perform search term replacement; see also |
| 167 // ToolbarModel::WouldPerformSearchTermReplacement(). | 160 // ToolbarModel::WouldPerformSearchTermReplacement(). |
| 168 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | 161 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); |
| 169 | 162 |
| 170 // Returns true if the origin chip should be shown in the toolbar. This | 163 // Returns true if the origin chip should be shown in the toolbar. This |
| 171 // also includes the related changes to the omnibox. | 164 // also includes the related changes to the omnibox. |
| 172 bool ShouldDisplayOriginChip(); | 165 bool ShouldDisplayOriginChip(); |
| 173 | 166 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 187 // | 180 // |
| 188 // Notice the scheme change. | 181 // Notice the scheme change. |
| 189 // | 182 // |
| 190 // If the input is already a privileged URL then that same URL is returned. | 183 // If the input is already a privileged URL then that same URL is returned. |
| 191 // | 184 // |
| 192 // If |url| is that of the online NTP, its host is replaced with "online-ntp". | 185 // If |url| is that of the online NTP, its host is replaced with "online-ntp". |
| 193 // This forces the NTP and search results pages to have different SiteIntances, | 186 // This forces the NTP and search results pages to have different SiteIntances, |
| 194 // and hence different processes. | 187 // and hence different processes. |
| 195 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile); | 188 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile); |
| 196 | 189 |
| 197 // Returns the staleness timeout (in seconds) that should be used to refresh the | |
| 198 // InstantLoader. | |
| 199 int GetInstantLoaderStalenessTimeoutSec(); | |
| 200 | |
| 201 // Returns true if |contents| corresponds to a preloaded instant extended NTP. | |
| 202 bool IsPreloadedInstantExtendedNTP(const content::WebContents* contents); | |
| 203 | |
| 204 // Rewrites |url| if | 190 // Rewrites |url| if |
| 205 // 1. |url| is kChromeUINewTabURL, | 191 // 1. |url| is kChromeUINewTabURL, |
| 206 // 2. InstantExtended is enabled, and | 192 // 2. InstantExtended is enabled, and |
| 207 // 3. The --instant-new-tab-url switch is set to a valid URL. | 193 // 3. The --instant-new-tab-url switch is set to a valid URL. |
| 208 // |url| is rewritten to the value of --instant-new-tab-url. | 194 // |url| is rewritten to the value of --instant-new-tab-url. |
| 209 bool HandleNewTabURLRewrite(GURL* url, | 195 bool HandleNewTabURLRewrite(GURL* url, |
| 210 content::BrowserContext* browser_context); | 196 content::BrowserContext* browser_context); |
| 211 // Reverses the operation from HandleNewTabURLRewrite. | 197 // Reverses the operation from HandleNewTabURLRewrite. |
| 212 bool HandleNewTabURLReverseRewrite(GURL* url, | 198 bool HandleNewTabURLReverseRewrite(GURL* url, |
| 213 content::BrowserContext* browser_context); | 199 content::BrowserContext* browser_context); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 248 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
| 263 bool default_value, | 249 bool default_value, |
| 264 const FieldTrialFlags& flags); | 250 const FieldTrialFlags& flags); |
| 265 | 251 |
| 266 // Returns the Cacheable New Tab Page URL for the given |profile|. | 252 // Returns the Cacheable New Tab Page URL for the given |profile|. |
| 267 GURL GetNewTabPageURL(Profile* profile); | 253 GURL GetNewTabPageURL(Profile* profile); |
| 268 | 254 |
| 269 } // namespace chrome | 255 } // namespace chrome |
| 270 | 256 |
| 271 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 257 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |