| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_ENGINES_SEARCH_TERMS_DATA_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Returns a string that will cause the search results page to update | 47 // Returns a string that will cause the search results page to update |
| 48 // incrementally. Currently, Instant Extended passes a different param to | 48 // incrementally. Currently, Instant Extended passes a different param to |
| 49 // search results pages that also has this effect, so by default this function | 49 // search results pages that also has this effect, so by default this function |
| 50 // returns the empty string when Instant Extended is enabled. However, when | 50 // returns the empty string when Instant Extended is enabled. However, when |
| 51 // doing instant search result prerendering, we still need to pass this param, | 51 // doing instant search result prerendering, we still need to pass this param, |
| 52 // as Instant Extended does not cause incremental updates by default for the | 52 // as Instant Extended does not cause incremental updates by default for the |
| 53 // prerender page. Callers should set |for_prerender| in this case to force | 53 // prerender page. Callers should set |for_prerender| in this case to force |
| 54 // the returned string to be non-empty. | 54 // the returned string to be non-empty. |
| 55 virtual std::string ForceInstantResultsParam(bool for_prerender) const; | 55 virtual std::string ForceInstantResultsParam(bool for_prerender) const; |
| 56 | 56 |
| 57 // Returns a string that will cause the search results page to autoplay audio |
| 58 // playback with answers. |
| 59 virtual std::string VoiceInputSourceParam(bool is_voice_input_source) const; |
| 60 |
| 57 // Returns a string indicating whether InstantExtended is enabled, suitable | 61 // Returns a string indicating whether InstantExtended is enabled, suitable |
| 58 // for adding as a query string param to the homepage or search requests. | 62 // for adding as a query string param to the homepage or search requests. |
| 59 // Returns an empty string otherwise. Determining this requires accessing the | 63 // Returns an empty string otherwise. Determining this requires accessing the |
| 60 // Profile, so this can only ever be non-empty for UIThreadSearchTermsData. | 64 // Profile, so this can only ever be non-empty for UIThreadSearchTermsData. |
| 61 virtual std::string InstantExtendedEnabledParam() const; | 65 virtual std::string InstantExtendedEnabledParam() const; |
| 62 | 66 |
| 63 // Returns a string indicating whether a non-default theme is active, | 67 // Returns a string indicating whether a non-default theme is active, |
| 64 // suitable for adding as a query string param to the homepage. This only | 68 // suitable for adding as a query string param to the homepage. This only |
| 65 // applies if Instant Extended is enabled. Returns an empty string otherwise. | 69 // applies if Instant Extended is enabled. Returns an empty string otherwise. |
| 66 // Determining this requires accessing the Profile, so this can only ever be | 70 // Determining this requires accessing the Profile, so this can only ever be |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 // NTPIsThemedParam(), will return the empty string. | 83 // NTPIsThemedParam(), will return the empty string. |
| 80 explicit UIThreadSearchTermsData(Profile* profile); | 84 explicit UIThreadSearchTermsData(Profile* profile); |
| 81 | 85 |
| 82 virtual std::string GoogleBaseURLValue() const OVERRIDE; | 86 virtual std::string GoogleBaseURLValue() const OVERRIDE; |
| 83 virtual std::string GetApplicationLocale() const OVERRIDE; | 87 virtual std::string GetApplicationLocale() const OVERRIDE; |
| 84 virtual base::string16 GetRlzParameterValue() const OVERRIDE; | 88 virtual base::string16 GetRlzParameterValue() const OVERRIDE; |
| 85 virtual std::string GetSearchClient() const OVERRIDE; | 89 virtual std::string GetSearchClient() const OVERRIDE; |
| 86 virtual std::string GetSuggestClient() const OVERRIDE; | 90 virtual std::string GetSuggestClient() const OVERRIDE; |
| 87 virtual std::string ForceInstantResultsParam( | 91 virtual std::string ForceInstantResultsParam( |
| 88 bool for_prerender) const OVERRIDE; | 92 bool for_prerender) const OVERRIDE; |
| 93 virtual std::string VoiceInputSourceParam( |
| 94 bool is_voice_input_source) const OVERRIDE; |
| 89 virtual std::string InstantExtendedEnabledParam() const OVERRIDE; | 95 virtual std::string InstantExtendedEnabledParam() const OVERRIDE; |
| 90 virtual std::string NTPIsThemedParam() const OVERRIDE; | 96 virtual std::string NTPIsThemedParam() const OVERRIDE; |
| 91 | 97 |
| 92 // Used by tests to override the value for the Google base URL. Passing the | 98 // Used by tests to override the value for the Google base URL. Passing the |
| 93 // empty string cancels this override. | 99 // empty string cancels this override. |
| 94 static void SetGoogleBaseURL(const std::string& base_url); | 100 static void SetGoogleBaseURL(const std::string& base_url); |
| 95 | 101 |
| 96 private: | 102 private: |
| 97 static std::string* google_base_url_; | 103 static std::string* google_base_url_; |
| 98 Profile* profile_; | 104 Profile* profile_; |
| 99 | 105 |
| 100 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); | 106 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); |
| 101 }; | 107 }; |
| 102 | 108 |
| 103 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ | 109 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ |
| OLD | NEW |