| 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/browser/extensions/extension_browser_event_router.h" | 5 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api_constants.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api_constants.h" |
| 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 DispatchTabUpdatedEvent(contents, changed_properties); | 446 DispatchTabUpdatedEvent(contents, changed_properties); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void ExtensionBrowserEventRouter::DispatchEvent(Profile* profile, | 449 void ExtensionBrowserEventRouter::DispatchEvent(Profile* profile, |
| 450 const char* event_name, | 450 const char* event_name, |
| 451 const std::string& json_args) { | 451 const std::string& json_args) { |
| 452 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) | 452 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) |
| 453 return; | 453 return; |
| 454 | 454 |
| 455 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 455 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 456 event_name, json_args, profile, GURL()); | 456 event_name, json_args, profile, GURL(), extensions::EventFilteringInfo()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void ExtensionBrowserEventRouter::DispatchEventToExtension( | 459 void ExtensionBrowserEventRouter::DispatchEventToExtension( |
| 460 Profile* profile, | 460 Profile* profile, |
| 461 const std::string& extension_id, | 461 const std::string& extension_id, |
| 462 const char* event_name, | 462 const char* event_name, |
| 463 const std::string& json_args) { | 463 const std::string& json_args) { |
| 464 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) | 464 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) |
| 465 return; | 465 return; |
| 466 | 466 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 } | 702 } |
| 703 | 703 |
| 704 if (event_name) { | 704 if (event_name) { |
| 705 DispatchEventWithTab(profile, | 705 DispatchEventWithTab(profile, |
| 706 extension_action.extension_id(), | 706 extension_action.extension_id(), |
| 707 event_name, | 707 event_name, |
| 708 tab_contents->web_contents(), | 708 tab_contents->web_contents(), |
| 709 true); | 709 true); |
| 710 } | 710 } |
| 711 } | 711 } |
| OLD | NEW |