| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |