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

Side by Side Diff: chrome/renderer/extensions/extension_helper.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/extension_helper.h" 5 #include "chrome/renderer/extensions/extension_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // This could be called before DidCreateDataSource, in which case the frame 223 // This could be called before DidCreateDataSource, in which case the frame
224 // won't be in the map. 224 // won't be in the map.
225 SchedulerMap::iterator i = g_schedulers.Get().find(frame); 225 SchedulerMap::iterator i = g_schedulers.Get().find(frame);
226 if (i == g_schedulers.Get().end()) 226 if (i == g_schedulers.Get().end())
227 return; 227 return;
228 228
229 delete i->second; 229 delete i->second;
230 g_schedulers.Get().erase(i); 230 g_schedulers.Get().erase(i);
231 } 231 }
232 232
233 void ExtensionHelper::DidMatchCSS(
234 WebKit::WebFrame* frame,
235 const WebKit::WebVector<WebKit::WebString>& newly_matching_selectors,
236 const WebKit::WebVector<WebKit::WebString>& stopped_matching_selectors) {
237 dispatcher_->DidMatchCSS(
238 frame, newly_matching_selectors, stopped_matching_selectors);
239 }
240
233 void ExtensionHelper::DidCreateDataSource(WebFrame* frame, WebDataSource* ds) { 241 void ExtensionHelper::DidCreateDataSource(WebFrame* frame, WebDataSource* ds) {
234 // Check first if we created a scheduler for the frame, since this function 242 // Check first if we created a scheduler for the frame, since this function
235 // gets called for navigations within the document. 243 // gets called for navigations within the document.
236 if (g_schedulers.Get().count(frame)) 244 if (g_schedulers.Get().count(frame))
237 return; 245 return;
238 246
239 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_); 247 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_);
240 } 248 }
241 249
242 void ExtensionHelper::OnExtensionResponse(int request_id, 250 void ExtensionHelper::OnExtensionResponse(int request_id,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); 366 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext();
359 ChromeV8Context* chrome_v8_context = 367 ChromeV8Context* chrome_v8_context =
360 dispatcher_->v8_context_set().GetByV8Context(script_context); 368 dispatcher_->v8_context_set().GetByV8Context(script_context);
361 if (!chrome_v8_context) 369 if (!chrome_v8_context)
362 return; 370 return;
363 chrome_v8_context->module_system()->CallModuleMethod( 371 chrome_v8_context->module_system()->CallModuleMethod(
364 "app.window", "onAppWindowClosed"); 372 "app.window", "onAppWindowClosed");
365 } 373 }
366 374
367 } // namespace extensions 375 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_helper.h ('k') | chrome/renderer/resources/extensions/content_watcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698