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 "extensions/browser/event_router.h" | 5 #include "extensions/browser/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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 }; | 98 }; |
99 | 99 |
100 // static | 100 // static |
101 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, | 101 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, |
102 void* browser_context_id, | 102 void* browser_context_id, |
103 const std::string& extension_id, | 103 const std::string& extension_id, |
104 const std::string& event_name, | 104 const std::string& event_name, |
105 ListValue* event_args, | 105 ListValue* event_args, |
106 UserGestureState user_gesture, | 106 UserGestureState user_gesture, |
107 const EventFilteringInfo& info) { | 107 const EventFilteringInfo& info) { |
| 108 printf("EventRouter::DispatchExtensionMessage: event_name: %s\n", event_name.c
_str()); |
108 NotifyApiEventDispatched(browser_context_id, | 109 NotifyApiEventDispatched(browser_context_id, |
109 extension_id, | 110 extension_id, |
110 event_name, | 111 event_name, |
111 make_scoped_ptr(event_args->DeepCopy())); | 112 make_scoped_ptr(event_args->DeepCopy())); |
112 | 113 |
113 ListValue args; | 114 ListValue args; |
114 args.Set(0, new base::StringValue(event_name)); | 115 args.Set(0, new base::StringValue(event_name)); |
115 args.Set(1, event_args); | 116 args.Set(1, event_args); |
116 args.Set(2, info.AsValue().release()); | 117 args.Set(2, info.AsValue().release()); |
117 ipc_sender->Send(new ExtensionMsg_MessageInvoke( | 118 ipc_sender->Send(new ExtensionMsg_MessageInvoke( |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 } | 771 } |
771 | 772 |
772 EventListenerInfo::EventListenerInfo(const std::string& event_name, | 773 EventListenerInfo::EventListenerInfo(const std::string& event_name, |
773 const std::string& extension_id, | 774 const std::string& extension_id, |
774 content::BrowserContext* browser_context) | 775 content::BrowserContext* browser_context) |
775 : event_name(event_name), | 776 : event_name(event_name), |
776 extension_id(extension_id), | 777 extension_id(extension_id), |
777 browser_context(browser_context) {} | 778 browser_context(browser_context) {} |
778 | 779 |
779 } // namespace extensions | 780 } // namespace extensions |
OLD | NEW |