Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: chrome/browser/chromeos/settings/cros_settings.h

Issue 10918027: Revert 154457 - Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // If the pref at the given |path| changes, we call the observer's Observe 84 // If the pref at the given |path| changes, we call the observer's Observe
85 // method with NOTIFICATION_SYSTEM_SETTING_CHANGED. 85 // method with NOTIFICATION_SYSTEM_SETTING_CHANGED.
86 void AddSettingsObserver(const char* path, 86 void AddSettingsObserver(const char* path,
87 content::NotificationObserver* obs); 87 content::NotificationObserver* obs);
88 void RemoveSettingsObserver(const char* path, 88 void RemoveSettingsObserver(const char* path,
89 content::NotificationObserver* obs); 89 content::NotificationObserver* obs);
90 90
91 // Returns the provider that handles settings with the |path| or prefix. 91 // Returns the provider that handles settings with the |path| or prefix.
92 CrosSettingsProvider* GetProvider(const std::string& path) const; 92 CrosSettingsProvider* GetProvider(const std::string& path) const;
93 93
94 // Forces all providers to reload their caches from the respective backing
95 // stores if they have any.
96 void ReloadProviders();
97
94 private: 98 private:
95 friend struct base::DefaultLazyInstanceTraits<CrosSettings>; 99 friend struct base::DefaultLazyInstanceTraits<CrosSettings>;
96 friend class CrosSettingsTest;
97
98 // Public for testing.
99 CrosSettings();
100 ~CrosSettings();
101
102 // Fires system setting change notification.
103 void FireObservers(const std::string& path);
104 100
105 // List of ChromeOS system settings providers. 101 // List of ChromeOS system settings providers.
106 std::vector<CrosSettingsProvider*> providers_; 102 std::vector<CrosSettingsProvider*> providers_;
107 103
108 // A map from settings names to a list of observers. Observers get fired in 104 // A map from settings names to a list of observers. Observers get fired in
109 // the order they are added. 105 // the order they are added.
110 typedef ObserverList<content::NotificationObserver, true> 106 typedef ObserverList<content::NotificationObserver, true>
111 NotificationObserverList; 107 NotificationObserverList;
112 typedef base::hash_map<std::string, NotificationObserverList*> 108 typedef base::hash_map<std::string, NotificationObserverList*>
113 SettingsObserverMap; 109 SettingsObserverMap;
114 SettingsObserverMap settings_observers_; 110 SettingsObserverMap settings_observers_;
115 111
112 CrosSettings();
113 ~CrosSettings();
114
115 // Fires system setting change notification.
116 void FireObservers(const std::string& path);
117
116 DISALLOW_COPY_AND_ASSIGN(CrosSettings); 118 DISALLOW_COPY_AND_ASSIGN(CrosSettings);
117 }; 119 };
118 120
119 } // namespace chromeos 121 } // namespace chromeos
120 122
121 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ 123 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | chrome/browser/chromeos/settings/cros_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698