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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 19045002: Use Blink support to watch CSS selectors directly instead of using a MutationObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial Created 7 years, 3 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/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 5f787b28bcf3343d41295771af57e820c84250aa..896022c0e348673621a95dca79ada316ae3b5648 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -396,7 +396,7 @@ void CallModuleMethod(const std::string& module_name,
} // namespace
Dispatcher::Dispatcher()
- : content_watcher_(new ContentWatcher(this)),
+ : content_watcher_(new ContentWatcher()),
is_webkit_initialized_(false),
webrequest_adblock_(false),
webrequest_adblock_plus_(false),
@@ -829,9 +829,6 @@ void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system,
module_system->RegisterNativeHandler("setIcon",
scoped_ptr<NativeHandler>(
new SetIconNatives(this, request_sender_.get(), context)));
- module_system->RegisterNativeHandler(
- "contentWatcherNative",
- content_watcher_->MakeNatives(context));
module_system->RegisterNativeHandler("activityLogger",
scoped_ptr<NativeHandler>(new APIActivityLogger(this, context)));
module_system->RegisterNativeHandler("renderViewObserverNatives",
@@ -898,7 +895,6 @@ void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system,
void Dispatcher::PopulateSourceMap() {
// Libraries.
- source_map_.RegisterSource("contentWatcher", IDR_CONTENT_WATCHER_JS);
source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER);
source_map_.RegisterSource(kEventBindings, IDR_EVENT_BINDINGS_JS);
source_map_.RegisterSource("imageUtil", IDR_IMAGE_UTIL_JS);
@@ -1218,6 +1214,15 @@ void Dispatcher::DidCreateDocumentElement(WebKit::WebFrame* frame) {
content_watcher_->DidCreateDocumentElement(frame);
}
+void Dispatcher::DidMatchCSS(
+ WebKit::WebFrame* frame,
+ const WebKit::WebVector<WebKit::WebString>& newlyMatchingSelectors,
+ const WebKit::WebVector<WebKit::WebString>& stoppedMatchingSelectors) {
+ content_watcher_->DidMatchCSS(
+ frame, newlyMatchingSelectors, stoppedMatchingSelectors);
+}
+
+
void Dispatcher::OnActivateExtension(const std::string& extension_id) {
const Extension* extension = extensions_.GetByID(extension_id);
if (!extension) {

Powered by Google App Engine
This is Rietveld 408576698