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/event_router_forwarder.h" | 5 #include "chrome/browser/extensions/event_router_forwarder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/event_router.h" | 10 #include "chrome/browser/extensions/event_router.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const std::string& event_name, | 105 const std::string& event_name, |
106 scoped_ptr<ListValue> event_args, | 106 scoped_ptr<ListValue> event_args, |
107 Profile* restrict_to_profile, | 107 Profile* restrict_to_profile, |
108 const GURL& event_url) { | 108 const GURL& event_url) { |
109 // We may not have an extension in cases like chromeos login | 109 // We may not have an extension in cases like chromeos login |
110 // (crosbug.com/12856), chrome_frame_net_tests.exe which reuses the chrome | 110 // (crosbug.com/12856), chrome_frame_net_tests.exe which reuses the chrome |
111 // browser single process framework. | 111 // browser single process framework. |
112 if (!extensions::ExtensionSystem::Get(profile)->event_router()) | 112 if (!extensions::ExtensionSystem::Get(profile)->event_router()) |
113 return; | 113 return; |
114 | 114 |
| 115 scoped_ptr<Event> event(new Event(event_name, event_args.Pass())); |
| 116 event->restrict_to_profile = restrict_to_profile; |
| 117 event->event_url = event_url; |
115 if (extension_id.empty()) { | 118 if (extension_id.empty()) { |
116 extensions::ExtensionSystem::Get(profile)->event_router()-> | 119 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass()); |
117 DispatchEventToRenderers( | |
118 event_name, event_args.Pass(), restrict_to_profile, event_url, | |
119 EventFilteringInfo()); | |
120 } else { | 120 } else { |
121 extensions::ExtensionSystem::Get(profile)->event_router()-> | 121 ExtensionSystem::Get(profile)->event_router()-> |
122 DispatchEventToExtension( | 122 DispatchEventToExtension(extension_id, event.Pass()); |
123 extension_id, | |
124 event_name, event_args.Pass(), restrict_to_profile, event_url); | |
125 } | 123 } |
126 } | 124 } |
127 | 125 |
128 } // namespace extensions | 126 } // namespace extensions |
OLD | NEW |