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