| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual std::string GoogleBaseURLValue() const; | 26 virtual std::string GoogleBaseURLValue() const; |
| 27 | 27 |
| 28 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term. This | 28 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term. This |
| 29 // implementation simply returns the default value. | 29 // implementation simply returns the default value. |
| 30 std::string GoogleBaseSuggestURLValue() const; | 30 std::string GoogleBaseSuggestURLValue() const; |
| 31 | 31 |
| 32 // Returns the locale used by the application. This implementation returns | 32 // Returns the locale used by the application. This implementation returns |
| 33 // "en" and thus should be overridden where the result is actually meaningful. | 33 // "en" and thus should be overridden where the result is actually meaningful. |
| 34 virtual std::string GetApplicationLocale() const; | 34 virtual std::string GetApplicationLocale() const; |
| 35 | 35 |
| 36 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 36 #if defined(ENABLE_RLZ) |
| 37 // Returns the value for the Chrome Omnibox rlz. This implementation returns | 37 // Returns the value for the Chrome Omnibox rlz. This implementation returns |
| 38 // the empty string. | 38 // the empty string. |
| 39 virtual string16 GetRlzParameterValue() const; | 39 virtual string16 GetRlzParameterValue() const; |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 // Returns a string indicating whether Instant (in the visible-preview mode) | 42 // Returns a string indicating whether Instant (in the visible-preview mode) |
| 43 // is enabled, suitable for adding as a query string param to the homepage | 43 // is enabled, suitable for adding as a query string param to the homepage |
| 44 // (instant_url) request. Returns an empty string if Instant is disabled, | 44 // (instant_url) request. Returns an empty string if Instant is disabled, |
| 45 // or if it's only active in a hidden field trial mode. Determining this | 45 // or if it's only active in a hidden field trial mode. Determining this |
| 46 // requires accessing the Profile, so this can only ever be non-empty for | 46 // requires accessing the Profile, so this can only ever be non-empty for |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 public: | 63 public: |
| 64 UIThreadSearchTermsData(); | 64 UIThreadSearchTermsData(); |
| 65 | 65 |
| 66 // Callers who need an accurate answer from InstantFieldTrialUrlParam() or | 66 // Callers who need an accurate answer from InstantFieldTrialUrlParam() or |
| 67 // InstantEnabledParam() must set the profile here before calling them. | 67 // InstantEnabledParam() must set the profile here before calling them. |
| 68 void set_profile(Profile* profile) { profile_ = profile; } | 68 void set_profile(Profile* profile) { profile_ = profile; } |
| 69 | 69 |
| 70 // Implementation of SearchTermsData. | 70 // Implementation of SearchTermsData. |
| 71 virtual std::string GoogleBaseURLValue() const OVERRIDE; | 71 virtual std::string GoogleBaseURLValue() const OVERRIDE; |
| 72 virtual std::string GetApplicationLocale() const OVERRIDE; | 72 virtual std::string GetApplicationLocale() const OVERRIDE; |
| 73 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 73 #if defined(ENABLE_RLZ) |
| 74 virtual string16 GetRlzParameterValue() const OVERRIDE; | 74 virtual string16 GetRlzParameterValue() const OVERRIDE; |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 // This returns the empty string unless set_profile() has been called with a | 77 // This returns the empty string unless set_profile() has been called with a |
| 78 // non-NULL Profile. | 78 // non-NULL Profile. |
| 79 virtual std::string InstantEnabledParam() const OVERRIDE; | 79 virtual std::string InstantEnabledParam() const OVERRIDE; |
| 80 | 80 |
| 81 // This returns the empty string unless set_profile() has been called with a | 81 // This returns the empty string unless set_profile() has been called with a |
| 82 // non-NULL Profile. | 82 // non-NULL Profile. |
| 83 virtual std::string InstantFieldTrialUrlParam() const OVERRIDE; | 83 virtual std::string InstantFieldTrialUrlParam() const OVERRIDE; |
| 84 | 84 |
| 85 // Used by tests to set the value for the Google base url. This takes | 85 // Used by tests to set the value for the Google base url. This takes |
| 86 // ownership of the given std::string. | 86 // ownership of the given std::string. |
| 87 static void SetGoogleBaseURL(std::string* google_base_url); | 87 static void SetGoogleBaseURL(std::string* google_base_url); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 static std::string* google_base_url_; | 90 static std::string* google_base_url_; |
| 91 Profile* profile_; | 91 Profile* profile_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); | 93 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ | 96 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ |
| OLD | NEW |