Chromium Code Reviews| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 // if the engine doesn't have an Instant URL, or if it shouldn't be used (say | 90 // if the engine doesn't have an Instant URL, or if it shouldn't be used (say |
| 91 // because it doesn't satisfy the requirements for extended mode or if Instant | 91 // because it doesn't satisfy the requirements for extended mode or if Instant |
| 92 // is disabled through preferences). Callers must check that the returned URL is | 92 // is disabled through preferences). Callers must check that the returned URL is |
| 93 // valid before using it. The value of |start_margin| is used for the "es_sm" | 93 // valid before using it. The value of |start_margin| is used for the "es_sm" |
| 94 // parameter in the URL. | 94 // parameter in the URL. |
| 95 // NOTE: This method expands the default search engine's instant_url template, | 95 // NOTE: This method expands the default search engine's instant_url template, |
| 96 // so it shouldn't be called from SearchTermsData or other such code that would | 96 // so it shouldn't be called from SearchTermsData or other such code that would |
| 97 // lead to an infinite recursion. | 97 // lead to an infinite recursion. |
| 98 GURL GetInstantURL(Profile* profile, int start_margin); | 98 GURL GetInstantURL(Profile* profile, int start_margin); |
| 99 | 99 |
| 100 // Returns the Local Instant URL of the default search engine. In particular, | 100 // Returns the Local Instant URL of the New Tab Page. |
| 101 // a Google search provider will include a special query parameter, indicating | 101 // TODO(kmadhusu): Remove this function and update the call sites. |
| 102 // to the JS that Google-specific New Tab Page elements should be rendered. | |
| 103 GURL GetLocalInstantURL(Profile* profile); | 102 GURL GetLocalInstantURL(Profile* profile); |
| 104 | 103 |
| 104 // Returns true if the default search provider is Google. Used to indicate the | |
| 105 // JS that Google-specific New Tab Page elements should be rendered. | |
| 106 bool DefaultSearchProviderIsGoogle(Profile* profile); | |
|
samarth
2013/07/17 16:39:45
Let's just move this as a helper function in an an
kmadhusu
2013/07/17 17:58:03
Done.
| |
| 107 | |
| 105 // Returns true if 'use_remote_ntp_on_startup' flag is enabled in field trials | 108 // Returns true if 'use_remote_ntp_on_startup' flag is enabled in field trials |
| 106 // to always show the remote NTP on browser startup. | 109 // to always show the remote NTP on browser startup. |
| 107 bool ShouldPreferRemoteNTPOnStartup(); | 110 bool ShouldPreferRemoteNTPOnStartup(); |
| 108 | 111 |
| 109 // Returns true if the Instant NTP should be preloaded before it is shown. | 112 // Returns true if the Instant NTP should be preloaded before it is shown. |
| 110 bool ShouldPreloadInstantNTP(Profile* profile); | 113 bool ShouldPreloadInstantNTP(Profile* profile); |
| 111 | 114 |
| 112 // Returns true if the Instant NTP should be shown and false if not. | 115 // Returns true if the Instant NTP should be shown and false if not. |
| 113 bool ShouldShowInstantNTP(); | 116 bool ShouldShowInstantNTP(); |
| 114 | 117 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 bool default_value, | 191 bool default_value, |
| 189 const FieldTrialFlags& flags); | 192 const FieldTrialFlags& flags); |
| 190 | 193 |
| 191 // Let tests reset the gate that prevents metrics from being sent more than | 194 // Let tests reset the gate that prevents metrics from being sent more than |
| 192 // once. | 195 // once. |
| 193 void ResetInstantExtendedOptInStateGateForTest(); | 196 void ResetInstantExtendedOptInStateGateForTest(); |
| 194 | 197 |
| 195 } // namespace chrome | 198 } // namespace chrome |
| 196 | 199 |
| 197 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 200 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |