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

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

Issue 8727037: Signed settings refactoring: Proper caching and more tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Fixed small bugs. Rebased to ToT. Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CROS_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // If the pref at the given path changes, we call the observer's Observe 85 // If the pref at the given path changes, we call the observer's Observe
86 // method with PREF_CHANGED. 86 // method with PREF_CHANGED.
87 void AddSettingsObserver(const char* path, 87 void AddSettingsObserver(const char* path,
88 content::NotificationObserver* obs); 88 content::NotificationObserver* obs);
89 void RemoveSettingsObserver(const char* path, 89 void RemoveSettingsObserver(const char* path,
90 content::NotificationObserver* obs); 90 content::NotificationObserver* obs);
91 91
92 // Returns the provider that handles settings with the path or prefix. 92 // Returns the provider that handles settings with the path or prefix.
93 CrosSettingsProvider* GetProvider(const std::string& path) const; 93 CrosSettingsProvider* GetProvider(const std::string& path) const;
94 94
95 // Forces all providers to reload their caches from the respective backing
96 // stores if they have any.
97 void ReloadProviders();
98
95 private: 99 private:
96 // List of ChromeOS system settings providers. 100 // List of ChromeOS system settings providers.
97 std::vector<CrosSettingsProvider*> providers_; 101 std::vector<CrosSettingsProvider*> providers_;
98 102
99 // A map from settings names to a list of observers. Observers get fired in 103 // A map from settings names to a list of observers. Observers get fired in
100 // the order they are added. 104 // the order they are added.
101 typedef ObserverList<content::NotificationObserver> NotificationObserverList; 105 typedef ObserverList<content::NotificationObserver> NotificationObserverList;
102 typedef base::hash_map<std::string, NotificationObserverList*> 106 typedef base::hash_map<std::string, NotificationObserverList*>
103 SettingsObserverMap; 107 SettingsObserverMap;
104 SettingsObserverMap settings_observers_; 108 SettingsObserverMap settings_observers_;
105 109
106 CrosSettings(); 110 CrosSettings();
107 ~CrosSettings(); 111 ~CrosSettings();
108 friend struct base::DefaultLazyInstanceTraits<CrosSettings>; 112 friend struct base::DefaultLazyInstanceTraits<CrosSettings>;
109 113
110 DISALLOW_COPY_AND_ASSIGN(CrosSettings); 114 DISALLOW_COPY_AND_ASSIGN(CrosSettings);
111 }; 115 };
112 116
113 } // namespace chromeos 117 } // namespace chromeos
114 118
115 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_ 119 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698