| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_API_
H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_API_
H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_API_
H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_API_
H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/scoped_observer.h" | 13 #include "base/scoped_observer.h" |
| 13 #include "components/search_engines/template_url_service.h" | 14 #include "components/search_engines/template_url_service.h" |
| 14 #include "extensions/browser/browser_context_keyed_api_factory.h" | 15 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 15 #include "extensions/browser/extension_registry_observer.h" | 16 #include "extensions/browser/extension_registry_observer.h" |
| 16 | 17 |
| 17 class Profile; | 18 class Profile; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 GetFactoryInstance(); | 32 GetFactoryInstance(); |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 friend class BrowserContextKeyedAPIFactory<SettingsOverridesAPI>; | 35 friend class BrowserContextKeyedAPIFactory<SettingsOverridesAPI>; |
| 35 | 36 |
| 36 typedef std::set<scoped_refptr<const Extension> > PendingExtensions; | 37 typedef std::set<scoped_refptr<const Extension> > PendingExtensions; |
| 37 | 38 |
| 38 // Wrappers around PreferenceAPI. | 39 // Wrappers around PreferenceAPI. |
| 39 void SetPref(const std::string& extension_id, | 40 void SetPref(const std::string& extension_id, |
| 40 const std::string& pref_key, | 41 const std::string& pref_key, |
| 41 base::Value* value); | 42 std::unique_ptr<base::Value> value) const; |
| 42 void UnsetPref(const std::string& extension_id, | 43 void UnsetPref(const std::string& extension_id, |
| 43 const std::string& pref_key); | 44 const std::string& pref_key) const; |
| 44 | 45 |
| 45 // ExtensionRegistryObserver implementation. | 46 // ExtensionRegistryObserver implementation. |
| 46 void OnExtensionLoaded(content::BrowserContext* browser_context, | 47 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 47 const Extension* extension) override; | 48 const Extension* extension) override; |
| 48 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 49 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 49 const Extension* extension, | 50 const Extension* extension, |
| 50 UnloadedExtensionInfo::Reason reason) override; | 51 UnloadedExtensionInfo::Reason reason) override; |
| 51 | 52 |
| 52 // KeyedService implementation. | 53 // KeyedService implementation. |
| 53 void Shutdown() override; | 54 void Shutdown() override; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 74 DISALLOW_COPY_AND_ASSIGN(SettingsOverridesAPI); | 75 DISALLOW_COPY_AND_ASSIGN(SettingsOverridesAPI); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 template <> | 78 template <> |
| 78 void BrowserContextKeyedAPIFactory< | 79 void BrowserContextKeyedAPIFactory< |
| 79 SettingsOverridesAPI>::DeclareFactoryDependencies(); | 80 SettingsOverridesAPI>::DeclareFactoryDependencies(); |
| 80 | 81 |
| 81 } // namespace extensions | 82 } // namespace extensions |
| 82 | 83 |
| 83 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_A
PI_H_ | 84 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_OVERRIDES_SETTINGS_OVERRIDES_A
PI_H_ |
| OLD | NEW |