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

Unified Diff: chrome/browser/extensions/api/storage/settings_frontend.h

Issue 189263013: Move extensions storage API implementation to src/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (move_storage) Created 6 years, 9 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: chrome/browser/extensions/api/storage/settings_frontend.h
diff --git a/chrome/browser/extensions/api/storage/settings_frontend.h b/chrome/browser/extensions/api/storage/settings_frontend.h
deleted file mode 100644
index cd0c594ef0834f157cffe4d5e1e708107d922618..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/api/storage/settings_frontend.h
+++ /dev/null
@@ -1,100 +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 CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_FRONTEND_H_
-#define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_FRONTEND_H_
-
-#include <map>
-#include <string>
-
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/extensions/api/storage/settings_observer.h"
-#include "chrome/browser/extensions/api/storage/settings_storage_factory.h"
-#include "chrome/browser/extensions/api/storage/value_store_cache.h"
-#include "extensions/browser/api/storage/settings_namespace.h"
-#include "extensions/browser/browser_context_keyed_api_factory.h"
-
-namespace content {
-class BrowserContext;
-}
-
-namespace extensions {
-
-// The component of extension settings which runs on the UI thread, as opposed
-// to SettingsBackend which lives on the FILE thread.
-class SettingsFrontend : public BrowserContextKeyedAPI {
- public:
- // Returns the current instance for |context|.
- static SettingsFrontend* Get(content::BrowserContext* context);
-
- // Creates with a specific |storage_factory|. Caller owns the object.
- static SettingsFrontend* CreateForTesting(
- const scoped_refptr<SettingsStorageFactory>& storage_factory,
- content::BrowserContext* context);
-
- // Public so tests can create and delete their own instances.
- virtual ~SettingsFrontend();
-
- // Returns the value store cache for |settings_namespace|.
- ValueStoreCache* GetValueStoreCache(
- settings_namespace::Namespace settings_namespace) const;
-
- // Returns true if |settings_namespace| is a valid namespace.
- bool IsStorageEnabled(settings_namespace::Namespace settings_namespace) const;
-
- // Runs |callback| with the storage area of the given |settings_namespace|
- // for the |extension|.
- void RunWithStorage(scoped_refptr<const Extension> extension,
- settings_namespace::Namespace settings_namespace,
- const ValueStoreCache::StorageCallback& callback);
-
- // Deletes the settings for the given |extension_id|.
- void DeleteStorageSoon(const std::string& extension_id);
-
- // Gets the thread-safe observer list.
- scoped_refptr<SettingsObserverList> GetObservers();
-
- void DisableStorageForTesting(
- settings_namespace::Namespace settings_namespace);
-
- // BrowserContextKeyedAPI implementation.
- static BrowserContextKeyedAPIFactory<SettingsFrontend>* GetFactoryInstance();
- static const char* service_name();
- static const bool kServiceRedirectedInIncognito = true;
- static const bool kServiceIsNULLWhileTesting = true;
-
- private:
- friend class BrowserContextKeyedAPIFactory<SettingsFrontend>;
-
- typedef std::map<settings_namespace::Namespace, ValueStoreCache*> CacheMap;
-
- // Constructor for normal BrowserContextKeyedAPI usage.
- explicit SettingsFrontend(content::BrowserContext* context);
-
- // Constructor for tests.
- SettingsFrontend(const scoped_refptr<SettingsStorageFactory>& storage_factory,
- content::BrowserContext* context);
-
- void Init(const scoped_refptr<SettingsStorageFactory>& storage_factory);
-
- // The (non-incognito) browser context this Frontend belongs to.
- content::BrowserContext* const browser_context_;
-
- // List of observers to settings changes.
- scoped_refptr<SettingsObserverList> observers_;
-
- // Observer for |browser_context_|.
- scoped_ptr<SettingsObserver> browser_context_observer_;
-
- // Maps a known namespace to its corresponding ValueStoreCache. The caches
- // are owned by this object.
- CacheMap caches_;
-
- DISALLOW_COPY_AND_ASSIGN(SettingsFrontend);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_FRONTEND_H_
« no previous file with comments | « chrome/browser/extensions/api/storage/settings_backend.cc ('k') | chrome/browser/extensions/api/storage/settings_frontend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698