| 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 // This class gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/prefs/public/pref_change_registrar.h" | 16 #include "base/prefs/public/pref_change_registrar.h" |
| 17 #include "base/prefs/public/pref_init_observer.h" |
| 17 #include "base/timer.h" | 18 #include "base/timer.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/profiles/profile_impl_io_data.h" | 20 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 20 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 22 | 23 |
| 23 class NetPrefObserver; | 24 class NetPrefObserver; |
| 24 class PrefService; | 25 class PrefService; |
| 26 class PrefServiceBase; |
| 25 class PromoResourceService; | 27 class PromoResourceService; |
| 26 class SSLConfigServiceManager; | 28 class SSLConfigServiceManager; |
| 27 | 29 |
| 28 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 29 namespace chromeos { | 31 namespace chromeos { |
| 30 class EnterpriseExtensionObserver; | 32 class EnterpriseExtensionObserver; |
| 31 class LocaleChangeGuard; | 33 class LocaleChangeGuard; |
| 32 class Preferences; | 34 class Preferences; |
| 33 } | 35 } |
| 34 #endif | 36 #endif |
| 35 | 37 |
| 36 namespace content { | 38 namespace content { |
| 37 class SpeechRecognitionPreferences; | 39 class SpeechRecognitionPreferences; |
| 38 } | 40 } |
| 39 | 41 |
| 40 namespace extensions { | 42 namespace extensions { |
| 41 class ExtensionSystem; | 43 class ExtensionSystem; |
| 42 } | 44 } |
| 43 | 45 |
| 44 // The default profile implementation. | 46 // The default profile implementation. |
| 45 class ProfileImpl : public Profile, | 47 class ProfileImpl : public Profile, |
| 46 public content::NotificationObserver { | 48 public content::NotificationObserver, |
| 49 public PrefObserver, |
| 50 public PrefInitObserver { |
| 47 public: | 51 public: |
| 48 // Value written to prefs when the exit type is EXIT_NORMAL. Public for tests. | 52 // Value written to prefs when the exit type is EXIT_NORMAL. Public for tests. |
| 49 static const char* const kPrefExitTypeNormal; | 53 static const char* const kPrefExitTypeNormal; |
| 50 | 54 |
| 51 virtual ~ProfileImpl(); | 55 virtual ~ProfileImpl(); |
| 52 | 56 |
| 53 static void RegisterUserPrefs(PrefService* prefs); | 57 static void RegisterUserPrefs(PrefService* prefs); |
| 54 | 58 |
| 55 // content::BrowserContext implementation: | 59 // content::BrowserContext implementation: |
| 56 virtual FilePath GetPath() OVERRIDE; | 60 virtual FilePath GetPath() OVERRIDE; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 virtual void InitChromeOSPreferences() OVERRIDE; | 124 virtual void InitChromeOSPreferences() OVERRIDE; |
| 121 #endif // defined(OS_CHROMEOS) | 125 #endif // defined(OS_CHROMEOS) |
| 122 | 126 |
| 123 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; | 127 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; |
| 124 | 128 |
| 125 // content::NotificationObserver implementation. | 129 // content::NotificationObserver implementation. |
| 126 virtual void Observe(int type, | 130 virtual void Observe(int type, |
| 127 const content::NotificationSource& source, | 131 const content::NotificationSource& source, |
| 128 const content::NotificationDetails& details) OVERRIDE; | 132 const content::NotificationDetails& details) OVERRIDE; |
| 129 | 133 |
| 134 // PrefObserver implementation. |
| 135 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 136 const std::string& pref_name) OVERRIDE; |
| 137 |
| 138 // PrefInitObserver implementation. |
| 139 virtual void OnInitializationCompleted(PrefServiceBase* pref_service, |
| 140 bool succeeded) OVERRIDE; |
| 141 |
| 130 private: | 142 private: |
| 131 friend class Profile; | 143 friend class Profile; |
| 132 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 144 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
| 133 ProfilesLaunchedAfterCrash); | 145 ProfilesLaunchedAfterCrash); |
| 134 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, ProfileReadmeCreated); | 146 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, ProfileReadmeCreated); |
| 135 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, | 147 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, |
| 136 ProfileDeletedBeforeReadmeCreated); | 148 ProfileDeletedBeforeReadmeCreated); |
| 137 | 149 |
| 138 // Delay, in milliseconds, before README file is created for a new profile. | 150 // Delay, in milliseconds, before README file is created for a new profile. |
| 139 // This is non-const for testing purposes. | 151 // This is non-const for testing purposes. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} | 269 // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} |
| 258 | 270 |
| 259 Profile::Delegate* delegate_; | 271 Profile::Delegate* delegate_; |
| 260 | 272 |
| 261 chrome_browser_net::Predictor* predictor_; | 273 chrome_browser_net::Predictor* predictor_; |
| 262 | 274 |
| 263 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 275 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
| 264 }; | 276 }; |
| 265 | 277 |
| 266 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 278 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| OLD | NEW |