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 16 matching lines...) Expand all Loading... |
27 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term. This | 27 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term. This |
28 // implementation simply returns the default value. | 28 // implementation simply returns the default value. |
29 std::string GoogleBaseSuggestURLValue() const; | 29 std::string GoogleBaseSuggestURLValue() const; |
30 | 30 |
31 // Returns the locale used by the application. This implementation returns | 31 // Returns the locale used by the application. This implementation returns |
32 // "en" and thus should be overridden where the result is actually meaningful. | 32 // "en" and thus should be overridden where the result is actually meaningful. |
33 virtual std::string GetApplicationLocale() const; | 33 virtual std::string GetApplicationLocale() const; |
34 | 34 |
35 // Returns the value for the Chrome Omnibox rlz. This implementation returns | 35 // Returns the value for the Chrome Omnibox rlz. This implementation returns |
36 // the empty string. | 36 // the empty string. |
37 virtual base::string16 GetRlzParameterValue() const; | 37 virtual base::string16 GetRlzParameterValue(bool from_app_list) const; |
38 | 38 |
39 // The optional client parameter passed with Google search requests. This | 39 // The optional client parameter passed with Google search requests. This |
40 // implementation returns the empty string. | 40 // implementation returns the empty string. |
41 virtual std::string GetSearchClient() const; | 41 virtual std::string GetSearchClient() const; |
42 | 42 |
43 // The suggest client parameter ("client") passed with Google suggest | 43 // The suggest client parameter ("client") passed with Google suggest |
44 // requests. See GetSuggestRequestIdentifier() for more details. | 44 // requests. See GetSuggestRequestIdentifier() for more details. |
45 // This implementation returns the empty string. | 45 // This implementation returns the empty string. |
46 virtual std::string GetSuggestClient() const; | 46 virtual std::string GetSuggestClient() const; |
47 | 47 |
(...skipping 16 matching lines...) Expand all Loading... |
64 | 64 |
65 // Implementation of SearchTermsData that is only usable on the UI thread. | 65 // Implementation of SearchTermsData that is only usable on the UI thread. |
66 class UIThreadSearchTermsData : public SearchTermsData { | 66 class UIThreadSearchTermsData : public SearchTermsData { |
67 public: | 67 public: |
68 // If |profile_| is NULL, the Google base URL accessors will return default | 68 // If |profile_| is NULL, the Google base URL accessors will return default |
69 // values, and NTPIsThemedParam() will return an empty string. | 69 // values, and NTPIsThemedParam() will return an empty string. |
70 explicit UIThreadSearchTermsData(Profile* profile); | 70 explicit UIThreadSearchTermsData(Profile* profile); |
71 | 71 |
72 virtual std::string GoogleBaseURLValue() const OVERRIDE; | 72 virtual std::string GoogleBaseURLValue() const OVERRIDE; |
73 virtual std::string GetApplicationLocale() const OVERRIDE; | 73 virtual std::string GetApplicationLocale() const OVERRIDE; |
74 virtual base::string16 GetRlzParameterValue() const OVERRIDE; | 74 virtual base::string16 GetRlzParameterValue(bool from_app_list) const |
| 75 OVERRIDE; |
75 virtual std::string GetSearchClient() const OVERRIDE; | 76 virtual std::string GetSearchClient() const OVERRIDE; |
76 virtual std::string GetSuggestClient() const OVERRIDE; | 77 virtual std::string GetSuggestClient() const OVERRIDE; |
77 virtual std::string GetSuggestRequestIdentifier() const OVERRIDE; | 78 virtual std::string GetSuggestRequestIdentifier() const OVERRIDE; |
78 virtual std::string NTPIsThemedParam() const OVERRIDE; | 79 virtual std::string NTPIsThemedParam() const OVERRIDE; |
79 | 80 |
80 // Used by tests to override the value for the Google base URL. Passing the | 81 // Used by tests to override the value for the Google base URL. Passing the |
81 // empty string cancels this override. | 82 // empty string cancels this override. |
82 static void SetGoogleBaseURL(const std::string& base_url); | 83 static void SetGoogleBaseURL(const std::string& base_url); |
83 | 84 |
84 private: | 85 private: |
85 static std::string* google_base_url_; | 86 static std::string* google_base_url_; |
86 Profile* profile_; | 87 Profile* profile_; |
87 | 88 |
88 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); | 89 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); |
89 }; | 90 }; |
90 | 91 |
91 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ | 92 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ |
OLD | NEW |