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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 } | 692 } |
693 | 693 |
694 if (event_name) { | 694 if (event_name) { |
695 DispatchEventWithTab(profile, | 695 DispatchEventWithTab(profile, |
696 extension_id, | 696 extension_id, |
697 event_name, | 697 event_name, |
698 tab_contents->web_contents(), | 698 tab_contents->web_contents(), |
699 true); | 699 true); |
700 } | 700 } |
701 } | 701 } |
OLD | NEW |