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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 | 103 |
104 // BrowserContextKeyedAPI implementation. | 104 // BrowserContextKeyedAPI implementation. |
105 static BrowserContextKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); | 105 static BrowserContextKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); |
106 | 106 |
107 // Convenience method to get the PreferenceAPI for a profile. | 107 // Convenience method to get the PreferenceAPI for a profile. |
108 static PreferenceAPI* Get(content::BrowserContext* context); | 108 static PreferenceAPI* Get(content::BrowserContext* context); |
109 | 109 |
110 // EventRouter::Observer implementation. | 110 // EventRouter::Observer implementation. |
111 void OnListenerAdded(const EventListenerInfo& details) override; | 111 void OnListenerAdded(const EventListenerInfo& details) override; |
112 | 112 |
113 void UpdateAnimationPolicy(); | |
not at google - send to devlin
2014/12/11 17:48:15
Blank line after this.
| |
113 private: | 114 private: |
114 friend class BrowserContextKeyedAPIFactory<PreferenceAPI>; | 115 friend class BrowserContextKeyedAPIFactory<PreferenceAPI>; |
115 | 116 |
116 // ContentSettingsStore::Observer implementation. | 117 // ContentSettingsStore::Observer implementation. |
117 void OnContentSettingChanged(const std::string& extension_id, | 118 void OnContentSettingChanged(const std::string& extension_id, |
118 bool incognito) override; | 119 bool incognito) override; |
119 | 120 |
120 // Clears incognito session-only content settings for all extensions. | 121 // Clears incognito session-only content settings for all extensions. |
121 void ClearIncognitoSessionOnlyContentSettings(); | 122 void ClearIncognitoSessionOnlyContentSettings(); |
122 | 123 |
123 // PreferenceAPIBase implementation. | 124 // PreferenceAPIBase implementation. |
124 ExtensionPrefs* extension_prefs() override; | 125 ExtensionPrefs* extension_prefs() override; |
125 ExtensionPrefValueMap* extension_pref_value_map() override; | 126 ExtensionPrefValueMap* extension_pref_value_map() override; |
126 scoped_refptr<ContentSettingsStore> content_settings_store() override; | 127 scoped_refptr<ContentSettingsStore> content_settings_store() override; |
127 | 128 |
128 Profile* profile_; | 129 Profile* profile_; |
130 PrefChangeRegistrar pref_change_registrar_; | |
129 | 131 |
130 // BrowserContextKeyedAPI implementation. | 132 // BrowserContextKeyedAPI implementation. |
131 static const char* service_name() { | 133 static const char* service_name() { |
132 return "PreferenceAPI"; | 134 return "PreferenceAPI"; |
133 } | 135 } |
134 static const bool kServiceIsNULLWhileTesting = true; | 136 static const bool kServiceIsNULLWhileTesting = true; |
135 static const bool kServiceRedirectedInIncognito = true; | 137 static const bool kServiceRedirectedInIncognito = true; |
136 | 138 |
137 // Created lazily upon OnListenerAdded. | 139 // Created lazily upon OnListenerAdded. |
138 scoped_ptr<PreferenceEventRouter> preference_event_router_; | 140 scoped_ptr<PreferenceEventRouter> preference_event_router_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 protected: | 213 protected: |
212 ~ClearPreferenceFunction() override; | 214 ~ClearPreferenceFunction() override; |
213 | 215 |
214 // ExtensionFunction: | 216 // ExtensionFunction: |
215 bool RunSync() override; | 217 bool RunSync() override; |
216 }; | 218 }; |
217 | 219 |
218 } // namespace extensions | 220 } // namespace extensions |
219 | 221 |
220 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 222 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
OLD | NEW |