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_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 }; | 89 }; |
90 | 90 |
91 class PreferenceAPI : public PreferenceAPIBase, | 91 class PreferenceAPI : public PreferenceAPIBase, |
92 public BrowserContextKeyedAPI, | 92 public BrowserContextKeyedAPI, |
93 public EventRouter::Observer, | 93 public EventRouter::Observer, |
94 public ContentSettingsStore::Observer { | 94 public ContentSettingsStore::Observer { |
95 public: | 95 public: |
96 explicit PreferenceAPI(content::BrowserContext* context); | 96 explicit PreferenceAPI(content::BrowserContext* context); |
97 virtual ~PreferenceAPI(); | 97 virtual ~PreferenceAPI(); |
98 | 98 |
99 // BrowserContextKeyedService implementation. | 99 // KeyedService implementation. |
100 virtual void Shutdown() OVERRIDE; | 100 virtual void Shutdown() OVERRIDE; |
101 | 101 |
102 // BrowserContextKeyedAPI implementation. | 102 // BrowserContextKeyedAPI implementation. |
103 static BrowserContextKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); | 103 static BrowserContextKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); |
104 | 104 |
105 // Convenience method to get the PreferenceAPI for a profile. | 105 // Convenience method to get the PreferenceAPI for a profile. |
106 static PreferenceAPI* Get(content::BrowserContext* context); | 106 static PreferenceAPI* Get(content::BrowserContext* context); |
107 | 107 |
108 // EventRouter::Observer implementation. | 108 // EventRouter::Observer implementation. |
109 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 109 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 protected: | 218 protected: |
219 virtual ~ClearPreferenceFunction(); | 219 virtual ~ClearPreferenceFunction(); |
220 | 220 |
221 // ExtensionFunction: | 221 // ExtensionFunction: |
222 virtual bool RunImpl() OVERRIDE; | 222 virtual bool RunImpl() OVERRIDE; |
223 }; | 223 }; |
224 | 224 |
225 } // namespace extensions | 225 } // namespace extensions |
226 | 226 |
227 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 227 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
OLD | NEW |