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

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

Issue 9422003: Migrate Declarative API bindings to new JSON objects generated by JSON compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed some stuff Created 8 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: chrome/browser/extensions/api/declarative/rules_registry.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry.h b/chrome/browser/extensions/api/declarative/rules_registry.h
index 8e816dd3a16d738265d98e0559d5ba27daec40b7..01e9297c897ce81ea767f7bc29e21b2b31d72642 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry.h
@@ -9,6 +9,9 @@
#include <string>
#include <vector>
+#include "chrome/common/extensions/api/experimental.declarative.h"
+#include "content/public/browser/browser_thread.h"
+
namespace base {
class DictionaryValue;
}
@@ -18,6 +21,8 @@ namespace extensions {
// Interface for rule registries.
class RulesRegistry {
public:
+ typedef extensions::api::experimental_declarative::Rule Rule;
Matt Perry 2012/02/21 23:43:42 I believe "using extensions::api::experimental_dec
battre 2012/02/28 22:29:18 This does not work.
+
virtual ~RulesRegistry() {}
// Registers |rules|, owned by |extension_id| to this RulesRegistry.
@@ -37,7 +42,7 @@ class RulesRegistry {
// relevant are added or none.
virtual std::string AddRules(
const std::string& extension_id,
- const std::vector<base::DictionaryValue*>& rules) = 0;
+ const std::vector<linked_ptr<Rule> >& rules) = 0;
// Unregisters all rules listed in |rule_identifiers| and owned by
// |extension_id| from this RulesRegistry.
@@ -64,15 +69,18 @@ class RulesRegistry {
// message otherwise.
virtual std::string GetRules(const std::string& extension_id,
const std::vector<std::string>& rule_identifiers,
- std::vector<base::DictionaryValue*>* out) = 0;
+ std::vector<linked_ptr<Rule> >* out) = 0;
// Same as GetRules but returns all rules owned by |extension_id|.
virtual std::string GetAllRules(const std::string& extension_id,
- std::vector<base::DictionaryValue*>* out) = 0;
+ std::vector<linked_ptr<Rule> >* out) = 0;
// Called to notify the RulesRegistry that an extension has been unloaded
// and all rules of this extension need to be removed.
virtual void OnExtensionUnloaded(const std::string& extension_id) = 0;
+
+ // Returns the ID of the thread on which the rules registry lives.
+ virtual content::BrowserThread::ID GetOwnerThread() = 0;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698