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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 bool IsInstantExtendedAPIEnabled(); | 64 bool IsInstantExtendedAPIEnabled(); |
| 65 | 65 |
| 66 // Returns whether the suggest is enabled for the given |profile|. | 66 // Returns whether the suggest is enabled for the given |profile|. |
| 67 bool IsSuggestPrefEnabled(Profile* profile); | 67 bool IsSuggestPrefEnabled(Profile* profile); |
| 68 | 68 |
| 69 // Returns the value to pass to the &espv CGI parameter when loading the | 69 // Returns the value to pass to the &espv CGI parameter when loading the |
| 70 // embedded search page from the user's default search provider. Returns 0 if | 70 // embedded search page from the user's default search provider. Returns 0 if |
| 71 // the Instant Extended API is not enabled. | 71 // the Instant Extended API is not enabled. |
| 72 uint64 EmbeddedSearchPageVersion(); | 72 uint64 EmbeddedSearchPageVersion(); |
| 73 | 73 |
| 74 // Returns a string indicating whether InstantExtended is enabled, suitable | |
| 75 // for adding as a query string param to the homepage or search requests. | |
| 76 // | |
| 77 // On desktop, |for_search| is set to true for search requests and this | |
| 78 // function returns an empty string when the query extraction is disabled. | |
| 79 // On mobile, |for_search| param is unused because the query extraction is | |
|
samarth
2014/02/04 17:17:05
This is confusing. Why isn't |for_search| set corr
kmadhusu
2014/02/04 17:49:59
I am not sure about the callers of that function.
kmadhusu
2014/02/04 19:39:54
Fixed.
| |
| 80 // always enabled. | |
| 81 std::string InstantExtendedEnabledParam(bool for_search); | |
| 82 | |
| 74 // Returns whether query extraction is enabled. | 83 // Returns whether query extraction is enabled. |
| 75 bool IsQueryExtractionEnabled(); | 84 bool IsQueryExtractionEnabled(); |
| 76 | 85 |
| 77 // Extracts and returns search terms from |url|. Returns empty string if the URL | 86 // Extracts and returns search terms from |url|. Returns empty string if the URL |
| 78 // is not secure or doesn't have a search term replacement key. Does not | 87 // is not secure or doesn't have a search term replacement key. Does not |
| 79 // consider IsQueryExtractionEnabled() and Instant support state of the page and | 88 // consider IsQueryExtractionEnabled() and Instant support state of the page and |
| 80 // does not check for a privileged process, so most callers should use | 89 // does not check for a privileged process, so most callers should use |
| 81 // GetSearchTerms() below instead. | 90 // GetSearchTerms() below instead. |
| 82 base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url); | 91 base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url); |
| 83 | 92 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 261 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
| 253 bool default_value, | 262 bool default_value, |
| 254 const FieldTrialFlags& flags); | 263 const FieldTrialFlags& flags); |
| 255 | 264 |
| 256 // Returns the Cacheable New Tab Page URL for the given |profile|. | 265 // Returns the Cacheable New Tab Page URL for the given |profile|. |
| 257 GURL GetNewTabPageURL(Profile* profile); | 266 GURL GetNewTabPageURL(Profile* profile); |
| 258 | 267 |
| 259 } // namespace chrome | 268 } // namespace chrome |
| 260 | 269 |
| 261 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 270 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |