Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: extensions/browser/api/extensions_api_client.h

Issue 180213008: Add ExtensionsApiClient interface, use it in the storage API SettingsFrontend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ead48259171bdd2c2bcdd5df56870f11b8934b9e
--- /dev/null
+++ b/extensions/browser/api/extensions_api_client.h
@@ -0,0 +1,52 @@
+// 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 embedders of the extensions module to customize their support for
+// API features.
+class ExtensionsApiClient {
+ public:
+ ExtensionsApiClient();
+ virtual ~ExtensionsApiClient();
+
+ // 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);
+
+ // Returns the single instance of |this|.
+ static ExtensionsApiClient* Get();
+
+ // Initializes the single instance. Does not take ownership.
+ static void Set(ExtensionsApiClient* client);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698