Index: extensions/browser/api/extensions_api_client.h |
diff --git a/extensions/browser/api/extensions_api_client.h b/extensions/browser/api/extensions_api_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f571493dbc556eef865d48f8c384b828aa63018b |
--- /dev/null |
+++ b/extensions/browser/api/extensions_api_client.h |
@@ -0,0 +1,56 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |
+#define EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |
+ |
+#include <map> |
+ |
+#include "base/memory/ref_counted.h" |
+#include "extensions/browser/api/storage/settings_namespace.h" |
+ |
+template <class T> |
+class ObserverListThreadSafe; |
+ |
+namespace content { |
+class BrowserContext; |
+} |
+ |
+namespace extensions { |
+ |
+class SettingsObserver; |
+class SettingsStorageFactory; |
+class ValueStoreCache; |
+ |
+// Allows the embedder of the extensions module to customize its support for |
+// API features. The embedder must create a single instance in the browser |
+// process. |
+class ExtensionsApiClient { |
Yoyo Zhou
2014/03/04 19:55:04
Since this provides a default implementation, I'd
James Cook
2014/03/04 20:55:58
Done.
|
+ public: |
+ // Construction sets the single instance. |
+ ExtensionsApiClient(); |
+ |
+ // Destruction clears the single instance. |
+ virtual ~ExtensionsApiClient(); |
+ |
+ // Returns the single instance of |this|. |
+ static ExtensionsApiClient* Get(); |
+ |
+ // Storage API support. |
+ |
+ // Add any additional value store caches (e.g. for chrome.storage.managed) |
+ // to |caches|. By default adds nothing. |
+ virtual void AddAdditionalValueStoreCaches( |
+ content::BrowserContext* context, |
+ scoped_refptr<SettingsStorageFactory> factory, |
+ scoped_refptr<ObserverListThreadSafe<SettingsObserver> > observers, |
+ std::map<settings_namespace::Namespace, ValueStoreCache*>* caches); |
+ |
+ // NOTE: If this interface gains too many methods (perhaps more than 20) it |
+ // should be split into one interface per API. |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ |