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

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

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reupload Created 7 years, 2 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 6c277d38ff61e86a170d6718e977ff25be426523..889961be9f5dcadfba82d90003aa42452df205f4 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry.h
@@ -19,8 +19,6 @@ class DictionaryValue;
namespace extensions {
-class RulesRegistry;
-
// Interface for rule registries.
//
// All functions except GetOwnerThread() and the destructor are only called on
@@ -28,10 +26,11 @@ class RulesRegistry;
class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
public:
typedef extensions::api::events::Rule Rule;
+ typedef std::pair<int, int> WebViewKey;
RulesRegistry(content::BrowserThread::ID owner_thread,
- const std::string& event_name)
- : owner_thread_(owner_thread), event_name_(event_name) {}
+ const std::string& event_name,
+ const WebViewKey& webview_key);
// Registers |rules|, owned by |extension_id| to this RulesRegistry.
// If a concrete RuleRegistry does not support some of the rules,
@@ -96,8 +95,13 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// The name of the event with which rules are registered.
const std::string& event_name() const { return event_name_; }
+ // The key that identifies the webview (or tabs) in which these rules apply.
+ const WebViewKey& webview_key() const {
+ return webview_key_;
+ }
+
protected:
- virtual ~RulesRegistry() {}
+ virtual ~RulesRegistry();
private:
friend class base::RefCountedThreadSafe<RulesRegistry>;
@@ -108,6 +112,9 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// The name of the event with which rules are registered.
const std::string event_name_;
+ // The key that identifies the context in which these rules apply.
+ WebViewKey webview_key_;
+
DISALLOW_COPY_AND_ASSIGN(RulesRegistry);
};

Powered by Google App Engine
This is Rietveld 408576698