OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |
| 6 #define EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "extensions/browser/api/storage/settings_namespace.h" |
| 12 |
| 13 template <class T> |
| 14 class ObserverListThreadSafe; |
| 15 |
| 16 namespace content { |
| 17 class BrowserContext; |
| 18 } |
| 19 |
| 20 namespace extensions { |
| 21 |
| 22 class SettingsObserver; |
| 23 class SettingsStorageFactory; |
| 24 class ValueStoreCache; |
| 25 |
| 26 // Allows embedders of the extensions module to customize their support for |
| 27 // API features. |
| 28 class ExtensionsApiClient { |
| 29 public: |
| 30 ExtensionsApiClient(); |
| 31 virtual ~ExtensionsApiClient(); |
| 32 |
| 33 // Storage API support. |
| 34 |
| 35 // Add any additional value store caches (e.g. for chrome.storage.managed) |
| 36 // to |caches|. By default adds nothing. |
| 37 virtual void AddAdditionalValueStoreCaches( |
| 38 content::BrowserContext* context, |
| 39 scoped_refptr<SettingsStorageFactory> factory, |
| 40 scoped_refptr<ObserverListThreadSafe<SettingsObserver> > observers, |
| 41 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches); |
| 42 |
| 43 // Returns the single instance of |this|. |
| 44 static ExtensionsApiClient* Get(); |
| 45 |
| 46 // Initializes the single instance. Does not take ownership. |
| 47 static void Set(ExtensionsApiClient* client); |
| 48 }; |
| 49 |
| 50 } // namespace extensions |
| 51 |
| 52 #endif // EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |
OLD | NEW |