| 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(), extensions::EventFilteringInfo()); | 454 event_name, json_args, profile, GURL()); |
| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } | 688 } |
| 689 | 689 |
| 690 if (event_name) { | 690 if (event_name) { |
| 691 DispatchEventWithTab(profile, | 691 DispatchEventWithTab(profile, |
| 692 extension_action.extension_id(), | 692 extension_action.extension_id(), |
| 693 event_name, | 693 event_name, |
| 694 tab_contents->web_contents(), | 694 tab_contents->web_contents(), |
| 695 true); | 695 true); |
| 696 } | 696 } |
| 697 } | 697 } |
| OLD | NEW |