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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.h

Issue 10560013: Persist declarative rules to the extension state store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RegisterKey Created 8 years, 6 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/declarative/rules_registry_storage_delegate.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.h b/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..063d641409199f00f186f2724b463c45ba867c6a
--- /dev/null
+++ b/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.h
@@ -0,0 +1,45 @@
+// 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_DECLARATIVE_RULES_REGISTRY_STORAGE_DELEGATE_H__
+#define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_STORAGE_DELEGATE_H__
+#pragma once
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+
+#include "chrome/browser/extensions/api/declarative/rules_registry_with_cache.h"
+
+class Profile;
+
+namespace extensions {
+
+// A Delegate to the RulesRegistryWithCache which handles reading/writing rules
+// to the extension state store. This class should be initialized on the UI
+// thread, but used on the RulesRegistry thread.
+class RulesRegistryStorageDelegate : public RulesRegistryWithCache::Delegate {
+ public:
+ RulesRegistryStorageDelegate();
+ virtual ~RulesRegistryStorageDelegate();
+
+ // Called on the UI thread to initialize the delegate.
+ void Init(Profile* profile,
+ RulesRegistryWithCache* rules_registry,
+ const std::string& storage_key);
+
+ // RulesRegistryWithCache::Delegate
+ virtual bool IsReady() OVERRIDE;
+ virtual void OnRulesChanged(RulesRegistryWithCache* rules_registry,
+ const std::string& extension_id) OVERRIDE;
+
+ private:
+ class Inner;
+
+ scoped_refptr<Inner> inner_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_STORAGE_DELEGATE_H__

Powered by Google App Engine
This is Rietveld 408576698