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/window_event_router.h" | 5 #include "chrome/browser/extensions/window_event_router.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/event_names.h" | 8 #include "chrome/browser/extensions/event_names.h" |
9 #include "chrome/browser/extensions/event_router.h" | 9 #include "chrome/browser/extensions/event_router.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 scoped_ptr<Event> event(new Event(event_names::kOnWindowFocusedChanged, | 142 scoped_ptr<Event> event(new Event(event_names::kOnWindowFocusedChanged, |
143 real_args.Pass())); | 143 real_args.Pass())); |
144 event->restrict_to_profile = window_profile; | 144 event->restrict_to_profile = window_profile; |
145 event->cross_incognito_args = cross_incognito_args.Pass(); | 145 event->cross_incognito_args = cross_incognito_args.Pass(); |
146 ExtensionSystem::Get(profile_)->event_router()->BroadcastEvent(event.Pass()); | 146 ExtensionSystem::Get(profile_)->event_router()->BroadcastEvent(event.Pass()); |
147 } | 147 } |
148 | 148 |
149 void WindowEventRouter::DispatchEvent(const char* event_name, | 149 void WindowEventRouter::DispatchEvent(const char* event_name, |
150 Profile* profile, | 150 Profile* profile, |
151 scoped_ptr<base::ListValue> args) { | 151 scoped_ptr<base::ListValue> args) { |
152 ExtensionSystem::Get(profile)->event_router()-> | 152 scoped_ptr<Event> event(new Event(event_name, args.Pass())); |
153 DispatchEventToRenderers(event_name, args.Pass(), profile, GURL()); | 153 event->restrict_to_profile = profile; |
| 154 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass()); |
154 } | 155 } |
155 | 156 |
156 } // namespace extensions | 157 } // namespace extensions |
OLD | NEW |