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 COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 5 #ifndef COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
6 #define COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 6 #define COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Returns the permanent country code stored for this client. Country code is | 121 // Returns the permanent country code stored for this client. Country code is |
122 // in the format of lowercase ISO 3166-1 alpha-2. Example: us, br, in | 122 // in the format of lowercase ISO 3166-1 alpha-2. Example: us, br, in |
123 std::string GetStoredPermanentCountry(); | 123 std::string GetStoredPermanentCountry(); |
124 | 124 |
125 // Forces an override of the stored permanent country. Returns true | 125 // Forces an override of the stored permanent country. Returns true |
126 // if the variable has been updated. Return false if the override country is | 126 // if the variable has been updated. Return false if the override country is |
127 // the same as the stored variable, or if the update failed for any other | 127 // the same as the stored variable, or if the update failed for any other |
128 // reason. | 128 // reason. |
129 bool OverrideStoredPermanentCountry(const std::string& override_country); | 129 bool OverrideStoredPermanentCountry(const std::string& override_country); |
130 | 130 |
| 131 // Returns what variations will consider to be the latest country. Returns |
| 132 // empty if it is not available. |
| 133 std::string GetLatestCountry() const; |
| 134 |
131 // Exposed for testing. | 135 // Exposed for testing. |
132 static std::string GetDefaultVariationsServerURLForTesting(); | 136 static std::string GetDefaultVariationsServerURLForTesting(); |
133 | 137 |
134 // Register Variations related prefs in Local State. | 138 // Register Variations related prefs in Local State. |
135 static void RegisterPrefs(PrefRegistrySimple* registry); | 139 static void RegisterPrefs(PrefRegistrySimple* registry); |
136 | 140 |
137 // Register Variations related prefs in the Profile prefs. | 141 // Register Variations related prefs in the Profile prefs. |
138 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 142 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
139 | 143 |
140 // Factory method for creating a VariationsService. Does not take ownership of | 144 // Factory method for creating a VariationsService. Does not take ownership of |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 base::ThreadChecker thread_checker_; | 335 base::ThreadChecker thread_checker_; |
332 | 336 |
333 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; | 337 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; |
334 | 338 |
335 DISALLOW_COPY_AND_ASSIGN(VariationsService); | 339 DISALLOW_COPY_AND_ASSIGN(VariationsService); |
336 }; | 340 }; |
337 | 341 |
338 } // namespace variations | 342 } // namespace variations |
339 | 343 |
340 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 344 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
OLD | NEW |