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

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

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 description to new Javascript events 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.cc
diff --git a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
index 7b379c1a67f2eeade2c708a517bd25de1713f5a7..8e36f26e67c8b5e0bbb69595709efeb9ae7af24d 100644
--- a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
@@ -24,12 +24,16 @@ using url_matcher::URLMatcherConditionSet;
namespace extensions {
ContentRulesRegistry::ContentRulesRegistry(Profile* profile,
+ const std::string& event_name,
+ const WatchedPagesRecipient
+ watched_pages_recipient,
RulesCacheDelegate* cache_delegate)
: RulesRegistry(profile,
- declarative_content_constants::kOnPageChanged,
+ event_name,
content::BrowserThread::UI,
cache_delegate,
- WebViewKey(0, 0)) {
+ WebViewKey(0, 0)),
+ watched_pages_recipient_(watched_pages_recipient) {
extension_info_map_ = ExtensionSystem::Get(profile)->info_map();
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
@@ -300,7 +304,10 @@ void ContentRulesRegistry::UpdateConditionCache() {
void ContentRulesRegistry::InstructRenderProcess(
content::RenderProcessHost* process) {
- process->Send(new ExtensionMsg_WatchPages(watched_css_selectors_));
+ process->Send(
+ new ExtensionMsg_WatchPages(event_name(),
+ watched_pages_recipient_,
+ watched_css_selectors_));
}
bool ContentRulesRegistry::IsEmpty() const {

Powered by Google App Engine
This is Rietveld 408576698