| 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 |
| 157 // Returns when we should show a search button in the omnibox. This may be any | 164 // Returns when we should show a search button in the omnibox. This may be any |
| 158 // of several values, some of which depend on whether the underlying state of | 165 // of several values, some of which depend on whether the underlying state of |
| 159 // the page would normally be to perform search term replacement; see also | 166 // the page would normally be to perform search term replacement; see also |
| 160 // ToolbarModel::WouldPerformSearchTermReplacement(). | 167 // ToolbarModel::WouldPerformSearchTermReplacement(). |
| 161 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | 168 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); |
| 162 | 169 |
| 163 // Returns true if the origin chip should be shown in the toolbar. This | 170 // Returns true if the origin chip should be shown in the toolbar. This |
| 164 // also includes the related changes to the omnibox. | 171 // also includes the related changes to the omnibox. |
| 165 bool ShouldDisplayOriginChip(); | 172 bool ShouldDisplayOriginChip(); |
| 166 | 173 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 180 // | 187 // |
| 181 // Notice the scheme change. | 188 // Notice the scheme change. |
| 182 // | 189 // |
| 183 // If the input is already a privileged URL then that same URL is returned. | 190 // If the input is already a privileged URL then that same URL is returned. |
| 184 // | 191 // |
| 185 // If |url| is that of the online NTP, its host is replaced with "online-ntp". | 192 // If |url| is that of the online NTP, its host is replaced with "online-ntp". |
| 186 // This forces the NTP and search results pages to have different SiteIntances, | 193 // This forces the NTP and search results pages to have different SiteIntances, |
| 187 // and hence different processes. | 194 // and hence different processes. |
| 188 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile); | 195 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile); |
| 189 | 196 |
| 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 |
| 190 // Rewrites |url| if | 204 // Rewrites |url| if |
| 191 // 1. |url| is kChromeUINewTabURL, | 205 // 1. |url| is kChromeUINewTabURL, |
| 192 // 2. InstantExtended is enabled, and | 206 // 2. InstantExtended is enabled, and |
| 193 // 3. The --instant-new-tab-url switch is set to a valid URL. | 207 // 3. The --instant-new-tab-url switch is set to a valid URL. |
| 194 // |url| is rewritten to the value of --instant-new-tab-url. | 208 // |url| is rewritten to the value of --instant-new-tab-url. |
| 195 bool HandleNewTabURLRewrite(GURL* url, | 209 bool HandleNewTabURLRewrite(GURL* url, |
| 196 content::BrowserContext* browser_context); | 210 content::BrowserContext* browser_context); |
| 197 // Reverses the operation from HandleNewTabURLRewrite. | 211 // Reverses the operation from HandleNewTabURLRewrite. |
| 198 bool HandleNewTabURLReverseRewrite(GURL* url, | 212 bool HandleNewTabURLReverseRewrite(GURL* url, |
| 199 content::BrowserContext* browser_context); | 213 content::BrowserContext* browser_context); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 262 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
| 249 bool default_value, | 263 bool default_value, |
| 250 const FieldTrialFlags& flags); | 264 const FieldTrialFlags& flags); |
| 251 | 265 |
| 252 // Returns the Cacheable New Tab Page URL for the given |profile|. | 266 // Returns the Cacheable New Tab Page URL for the given |profile|. |
| 253 GURL GetNewTabPageURL(Profile* profile); | 267 GURL GetNewTabPageURL(Profile* profile); |
| 254 | 268 |
| 255 } // namespace chrome | 269 } // namespace chrome |
| 256 | 270 |
| 257 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 271 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |