summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 17:36:54 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 17:36:54 +0000
commitebc7df9a1817371e1be730e19c4b9cc8373c2315 (patch)
tree434bd41a162fcef65c8f1ca299a2f865420c3879 /apps
parent03d7a30b64a766152a17a2a8e350feed879892e0 (diff)
downloadchromium_src-ebc7df9a1817371e1be730e19c4b9cc8373c2315.zip
chromium_src-ebc7df9a1817371e1be730e19c4b9cc8373c2315.tar.gz
chromium_src-ebc7df9a1817371e1be730e19c4b9cc8373c2315.tar.bz2
Reland: Add ExtensionsApiClient interface, use it in the storage API SettingsFrontend
app_shell needs the chrome.storage.local extension API so the core storage implementation is moving to //extensions/browser/api. However, the "managed storage" API implementation needs to remain in Chrome. * Introduce ExtensionsApiClient in extensions/browser/api * Introduce ChromeExtensionsApiClient in chrome/browser/extensions/api * Delegate out the storage ManagedValueStoreCache creation to Chrome * Move settings_namespace.h/cc to e/b/api/storage so we can use an enum in the client interface definition Most APIs will probably need to make only one or two client interface calls, so we're starting with a single ExtensionsApiClient interface. It we find individual APIs tend to need a lot of methods we can split it into one client interface per API, but that seems like overkill right now. Reland of https://codereview.chromium.org/180213008/ with fixes for Android GCMProfileServiceSingleProfileTest.Unregister BUG=348058 TEST=unit_tests *Settings* and browser_tests ExtensionSettings* TBR=rdevlin.cronin@chromium.org, rockot@chromium.org, yoz@chromium.org Review URL: https://codereview.chromium.org/184853012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r--apps/shell/browser/shell_extensions_browser_client.cc4
-rw-r--r--apps/shell/browser/shell_extensions_browser_client.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/apps/shell/browser/shell_extensions_browser_client.cc b/apps/shell/browser/shell_extensions_browser_client.cc
index 8089b5e..7245960 100644
--- a/apps/shell/browser/shell_extensions_browser_client.cc
+++ b/apps/shell/browser/shell_extensions_browser_client.cc
@@ -12,6 +12,7 @@
#include "chrome/common/extensions/api/generated_api.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "components/user_prefs/user_prefs.h"
+#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/app_sorting.h"
#include "extensions/browser/extension_prefs.h"
@@ -27,10 +28,9 @@ void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) {
} // namespace
-
ShellExtensionsBrowserClient::ShellExtensionsBrowserClient(
BrowserContext* context)
- : browser_context_(context) {
+ : browser_context_(context), api_client_(new ExtensionsAPIClient) {
// Set up the preferences service.
base::PrefServiceFactory factory;
factory.set_user_prefs(new TestingPrefStore);
diff --git a/apps/shell/browser/shell_extensions_browser_client.h b/apps/shell/browser/shell_extensions_browser_client.h
index 529f37b..55b7f49 100644
--- a/apps/shell/browser/shell_extensions_browser_client.h
+++ b/apps/shell/browser/shell_extensions_browser_client.h
@@ -12,6 +12,8 @@ class PrefService;
namespace extensions {
+class ExtensionsAPIClient;
+
// An ExtensionsBrowserClient that supports a single content::BrowserContent
// with no related incognito context.
class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
@@ -65,6 +67,9 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
// The single BrowserContext for app_shell. Not owned.
content::BrowserContext* browser_context_;
+ // Support for extension APIs.
+ scoped_ptr<ExtensionsAPIClient> api_client_;
+
// The PrefService for |browser_context_|.
scoped_ptr<PrefService> prefs_;