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_PROFILES_CHROME_VERSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_ |
6 #define CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_ | 6 #define CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 class PrefService; | 12 class PrefService; |
| 13 class PrefServiceSyncable; |
13 | 14 |
14 // This service manages a pref which is used to determine the version of | 15 // This service manages a pref which is used to determine the version of |
15 // Chrome by which the profile was created. | 16 // Chrome by which the profile was created. |
16 class ChromeVersionService { | 17 class ChromeVersionService { |
17 public: | 18 public: |
18 // Register the user pref we use. | 19 // Register the user pref we use. |
19 static void RegisterUserPrefs(PrefService* prefs); | 20 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
20 | 21 |
21 // Sets the version string in the pref for the current profile. | 22 // Sets the version string in the pref for the current profile. |
22 static void SetVersion(PrefService* prefs, const std::string& version); | 23 static void SetVersion(PrefService* prefs, const std::string& version); |
23 | 24 |
24 // Returns the version of Chrome which created the profile. | 25 // Returns the version of Chrome which created the profile. |
25 static std::string GetVersion(PrefService* prefs); | 26 static std::string GetVersion(PrefService* prefs); |
26 | 27 |
27 // Handles setting the profile.created_by_version Pref | 28 // Handles setting the profile.created_by_version Pref |
28 static void OnProfileLoaded(PrefService* prefs, bool is_new_profile); | 29 static void OnProfileLoaded(PrefService* prefs, bool is_new_profile); |
29 | 30 |
30 private: | 31 private: |
31 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeVersionService); | 32 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeVersionService); |
32 }; | 33 }; |
33 | 34 |
34 #endif // CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_ | 35 #endif // CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_ |
OLD | NEW |