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

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: unCamelCase in Chrome code. 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
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 5f787b28bcf3343d41295771af57e820c84250aa..c1390954a2777e68e7ebfb9aecefeb7371289751 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>& newly_matching_selectors,
+ const WebKit::WebVector<WebKit::WebString>& stopped_matching_selectors) {
+ content_watcher_->DidMatchCSS(
+ frame, newly_matching_selectors, stopped_matching_selectors);
+}
+
+
void Dispatcher::OnActivateExtension(const std::string& extension_id) {
const Extension* extension = extensions_.GetByID(extension_id);
if (!extension) {
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698