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

Unified Diff: chrome/browser/extensions/api/declarative_content/content_rules_registry.h

Issue 344433003: Prepare declarativeContent API for new script injection feature. Added Javascript types and functio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add note about what it means to revert RequestContentScript Created 6 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_content/content_rules_registry.h
diff --git a/chrome/browser/extensions/api/declarative_content/content_rules_registry.h b/chrome/browser/extensions/api/declarative_content/content_rules_registry.h
index 9224374a7ee358dcc6e100be0aac06b2723ea685..38636de999de1ffd5f40b0699ce9d642b0805b34 100644
--- a/chrome/browser/extensions/api/declarative_content/content_rules_registry.h
+++ b/chrome/browser/extensions/api/declarative_content/content_rules_registry.h
@@ -22,6 +22,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/info_map.h"
+#include "extensions/common/watched_pages_recipient.h"
class Profile;
class ContentPermissions;
@@ -64,7 +65,10 @@ class ContentRulesRegistry : public RulesRegistry,
public:
// For testing, |ui_part| can be NULL. In that case it constructs the
// registry with storage functionality suspended.
- ContentRulesRegistry(Profile* profile, RulesCacheDelegate* cache_delegate);
+ ContentRulesRegistry(Profile* profile,
+ const std::string& event_name,
+ const WatchedPagesRecipient watched_pages_recipient,
+ RulesCacheDelegate* cache_delegate);
// Applies all content rules given an update (CSS match change or
// page navigation, for now) from the renderer.
@@ -137,6 +141,8 @@ class ContentRulesRegistry : public RulesRegistry,
// All CSS selectors any rule's conditions watch for.
std::vector<std::string> watched_css_selectors_;
+ WatchedPagesRecipient watched_pages_recipient_;
+
// Manages our notification registrations.
content::NotificationRegistrar registrar_;
@@ -145,6 +151,9 @@ class ContentRulesRegistry : public RulesRegistry,
DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry);
};
+// Map from event_name to registry pointer.
+typedef std::map<std::string, ContentRulesRegistry*> ContentRulesRegistryMap;
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698