| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 DispatchTabUpdatedEvent(contents, changed_properties); | 444 DispatchTabUpdatedEvent(contents, changed_properties); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void ExtensionBrowserEventRouter::DispatchEvent(Profile* profile, | 447 void ExtensionBrowserEventRouter::DispatchEvent(Profile* profile, |
| 448 const char* event_name, | 448 const char* event_name, |
| 449 const std::string& json_args) { | 449 const std::string& json_args) { |
| 450 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) | 450 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) |
| 451 return; | 451 return; |
| 452 | 452 |
| 453 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 453 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 454 event_name, json_args, profile, GURL()); | 454 event_name, json_args, profile, GURL(), extensions::EventFilteringInfo()); |
| 455 } | 455 } |
| 456 | 456 |
| 457 void ExtensionBrowserEventRouter::DispatchEventToExtension( | 457 void ExtensionBrowserEventRouter::DispatchEventToExtension( |
| 458 Profile* profile, | 458 Profile* profile, |
| 459 const std::string& extension_id, | 459 const std::string& extension_id, |
| 460 const char* event_name, | 460 const char* event_name, |
| 461 const std::string& json_args) { | 461 const std::string& json_args) { |
| 462 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) | 462 if (!profile_->IsSameProfile(profile) || !profile->GetExtensionEventRouter()) |
| 463 return; | 463 return; |
| 464 | 464 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 } | 695 } |
| 696 | 696 |
| 697 if (event_name) { | 697 if (event_name) { |
| 698 DispatchEventWithTab(profile, | 698 DispatchEventWithTab(profile, |
| 699 extension_id, | 699 extension_id, |
| 700 event_name, | 700 event_name, |
| 701 tab_contents->web_contents(), | 701 tab_contents->web_contents(), |
| 702 true); | 702 true); |
| 703 } | 703 } |
| 704 } | 704 } |
| OLD | NEW |