summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 19:39:24 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 19:39:24 +0000
commit83ff0e9fc08bf489c3b733b9aea10f6e2cecfac2 (patch)
tree3f3cdabaf887baf160ebd93ba62fff4416723cfd /extensions/browser/api
parent249754f33987cb6924eea13320173fad339cb1e5 (diff)
downloadchromium_src-83ff0e9fc08bf489c3b733b9aea10f6e2cecfac2.zip
chromium_src-83ff0e9fc08bf489c3b733b9aea10f6e2cecfac2.tar.gz
chromium_src-83ff0e9fc08bf489c3b733b9aea10f6e2cecfac2.tar.bz2
Revert r255069 "Add ExtensionsApiClient interface, use it in the storage API SettingsFrontend"
Likely broke GCMProfileServiceSingleProfileTest.Unregister Android. BUG=348058 Review URL: https://codereview.chromium.org/184343007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/api')
-rw-r--r--extensions/browser/api/extensions_api_client.cc27
-rw-r--r--extensions/browser/api/extensions_api_client.h56
-rw-r--r--extensions/browser/api/storage/settings_namespace.cc46
-rw-r--r--extensions/browser/api/storage/settings_namespace.h34
4 files changed, 0 insertions, 163 deletions
diff --git a/extensions/browser/api/extensions_api_client.cc b/extensions/browser/api/extensions_api_client.cc
deleted file mode 100644
index c4f8013..0000000
--- a/extensions/browser/api/extensions_api_client.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// 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.
-
-#include "extensions/browser/api/extensions_api_client.h"
-
-namespace extensions {
-namespace {
-
-ExtensionsAPIClient* g_instance = NULL;
-
-} // namespace
-
-ExtensionsAPIClient::ExtensionsAPIClient() { g_instance = this; }
-
-ExtensionsAPIClient::~ExtensionsAPIClient() { g_instance = NULL; }
-
-// static
-ExtensionsAPIClient* ExtensionsAPIClient::Get() { return g_instance; }
-
-void ExtensionsAPIClient::AddAdditionalValueStoreCaches(
- content::BrowserContext* context,
- const scoped_refptr<SettingsStorageFactory>& factory,
- const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers,
- std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) {}
-
-} // namespace extensions
diff --git a/extensions/browser/api/extensions_api_client.h b/extensions/browser/api/extensions_api_client.h
deleted file mode 100644
index 88dbaa4..0000000
--- a/extensions/browser/api/extensions_api_client.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// 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. Provides a default implementation that does nothing.
-class ExtensionsAPIClient {
- 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,
- const scoped_refptr<SettingsStorageFactory>& factory,
- const 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_
diff --git a/extensions/browser/api/storage/settings_namespace.cc b/extensions/browser/api/storage/settings_namespace.cc
deleted file mode 100644
index e178c7c..0000000
--- a/extensions/browser/api/storage/settings_namespace.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "extensions/browser/api/storage/settings_namespace.h"
-
-#include "base/logging.h"
-
-namespace extensions {
-
-namespace settings_namespace {
-
-namespace {
-const char kLocalNamespace[] = "local";
-const char kSyncNamespace[] = "sync";
-const char kManagedNamespace[] = "managed";
-} // namespace
-
-std::string ToString(Namespace settings_namespace) {
- switch (settings_namespace) {
- case LOCAL:
- return kLocalNamespace;
- case SYNC:
- return kSyncNamespace;
- case MANAGED:
- return kManagedNamespace;
- case INVALID:
- break;
- }
- NOTREACHED();
- return std::string();
-}
-
-Namespace FromString(const std::string& namespace_string) {
- if (namespace_string == kLocalNamespace)
- return LOCAL;
- if (namespace_string == kSyncNamespace)
- return SYNC;
- if (namespace_string == kManagedNamespace)
- return MANAGED;
- return INVALID;
-}
-
-} // namespace settings_namespace
-
-} // namespace extensions
diff --git a/extensions/browser/api/storage/settings_namespace.h b/extensions/browser/api/storage/settings_namespace.h
deleted file mode 100644
index 7a5a812..0000000
--- a/extensions/browser/api/storage/settings_namespace.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 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_STORAGE_SETTINGS_NAMESPACE_H_
-#define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_NAMESPACE_H_
-
-#include <string>
-
-namespace extensions {
-
-namespace settings_namespace {
-
-// The namespaces of the storage areas.
-enum Namespace {
- LOCAL, // "local" i.e. chrome.storage.local
- SYNC, // "sync" i.e. chrome.storage.sync
- MANAGED, // "managed" i.e. chrome.storage.managed
- INVALID
-};
-
-// Converts a namespace to its string representation.
-// Namespace must not be INVALID.
-std::string ToString(Namespace settings_namespace);
-
-// Converts a string representation of a namespace to its namespace, or INVALID
-// if the string doesn't map to one.
-Namespace FromString(const std::string& ns_string);
-
-} // namespace settings_namespace
-
-} // namespace extensions
-
-#endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_NAMESPACE_H_