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.h" | 5 #include "chrome/browser/extensions/event_router.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 // static | 119 // static |
120 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, | 120 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, |
121 void* profile_id, | 121 void* profile_id, |
122 const std::string& extension_id, | 122 const std::string& extension_id, |
123 const std::string& event_name, | 123 const std::string& event_name, |
124 ListValue* event_args, | 124 ListValue* event_args, |
125 UserGestureState user_gesture, | 125 UserGestureState user_gesture, |
126 const EventFilteringInfo& info) { | 126 const EventFilteringInfo& info) { |
127 if (ActivityLog::IsLogEnabledOnAnyProfile()) { | 127 LogExtensionEventMessage(profile_id, extension_id, event_name, |
128 LogExtensionEventMessage(profile_id, extension_id, event_name, | 128 scoped_ptr<ListValue>(event_args->DeepCopy())); |
129 scoped_ptr<ListValue>(event_args->DeepCopy())); | |
130 } | |
131 | 129 |
132 ListValue args; | 130 ListValue args; |
133 args.Set(0, new base::StringValue(event_name)); | 131 args.Set(0, new base::StringValue(event_name)); |
134 args.Set(1, event_args); | 132 args.Set(1, event_args); |
135 args.Set(2, info.AsValue().release()); | 133 args.Set(2, info.AsValue().release()); |
136 ipc_sender->Send(new ExtensionMsg_MessageInvoke( | 134 ipc_sender->Send(new ExtensionMsg_MessageInvoke( |
137 MSG_ROUTING_CONTROL, | 135 MSG_ROUTING_CONTROL, |
138 extension_id, | 136 extension_id, |
139 "event_bindings", | 137 "event_bindings", |
140 "dispatchEvent", | 138 "dispatchEvent", |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 copy->will_dispatch_callback = will_dispatch_callback; | 859 copy->will_dispatch_callback = will_dispatch_callback; |
862 return copy; | 860 return copy; |
863 } | 861 } |
864 | 862 |
865 EventListenerInfo::EventListenerInfo(const std::string& event_name, | 863 EventListenerInfo::EventListenerInfo(const std::string& event_name, |
866 const std::string& extension_id) | 864 const std::string& extension_id) |
867 : event_name(event_name), | 865 : event_name(event_name), |
868 extension_id(extension_id) {} | 866 extension_id(extension_id) {} |
869 | 867 |
870 } // namespace extensions | 868 } // namespace extensions |
OLD | NEW |