| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_POWER_PREFS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POWER_POWER_PREFS_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" |
| 13 |
| 14 class PrefChangeRegistrar; |
| 15 class Profile; |
| 16 |
| 17 namespace user_prefs { |
| 18 class PrefRegistrySyncable; |
| 19 } |
| 20 |
| 21 namespace chromeos { |
| 22 |
| 23 class PowerPolicyController; |
| 24 |
| 25 // Sends an updated power policy to the |power_policy_controller| whenever one |
| 26 // of the power-related prefs changes. |
| 27 class PowerPrefs : public content::NotificationObserver { |
| 28 public: |
| 29 explicit PowerPrefs(PowerPolicyController* power_policy_controller); |
| 30 virtual ~PowerPrefs(); |
| 31 |
| 32 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry, |
| 33 bool for_signin_profile); |
| 34 |
| 35 // content::NotificationObserver: |
| 36 virtual void Observe(int type, |
| 37 const content::NotificationSource& source, |
| 38 const content::NotificationDetails& details) OVERRIDE; |
| 39 |
| 40 void UpdatePowerPolicyFromPrefs(); |
| 41 |
| 42 private: |
| 43 friend class PowerPrefsTest; |
| 44 |
| 45 void SetProfile(Profile* profile); |
| 46 |
| 47 PowerPolicyController* power_policy_controller_; // Not owned. |
| 48 |
| 49 content::NotificationRegistrar notification_registrar_; |
| 50 |
| 51 Profile* profile_; // Not owned. |
| 52 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(PowerPrefs); |
| 55 }; |
| 56 |
| 57 } // namespace chromeos |
| 58 |
| 59 #endif // CHROME_BROWSER_CHROMEOS_POWER_POWER_PREFS_H_ |
| OLD | NEW |