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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (!extension_service) { | 120 if (!extension_service) { |
121 LOG(WARNING) << "ExtensionService does not seem to be available " | 121 LOG(WARNING) << "ExtensionService does not seem to be available " |
122 << "(this may be normal for unit tests)"; | 122 << "(this may be normal for unit tests)"; |
123 } else { | 123 } else { |
124 const Extension* extension = | 124 const Extension* extension = |
125 extension_service->extensions()->GetByID(extension_id); | 125 extension_service->extensions()->GetByID(extension_id); |
126 if (!extension) { | 126 if (!extension) { |
127 LOG(WARNING) << "Extension " << extension_id << " not found!"; | 127 LOG(WARNING) << "Extension " << extension_id << " not found!"; |
128 } else { | 128 } else { |
129 ActivityLog::GetInstance(profile)->LogEventAction( | 129 ActivityLog::GetInstance(profile)->LogEventAction( |
130 extension, event_name, event_args.get(), std::string()); | 130 extension->id(), event_name, event_args.get(), std::string()); |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 // static | 136 // static |
137 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, | 137 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, |
138 void* profile_id, | 138 void* profile_id, |
139 const std::string& extension_id, | 139 const std::string& extension_id, |
140 const std::string& event_name, | 140 const std::string& event_name, |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 copy->will_dispatch_callback = will_dispatch_callback; | 828 copy->will_dispatch_callback = will_dispatch_callback; |
829 return copy; | 829 return copy; |
830 } | 830 } |
831 | 831 |
832 EventListenerInfo::EventListenerInfo(const std::string& event_name, | 832 EventListenerInfo::EventListenerInfo(const std::string& event_name, |
833 const std::string& extension_id) | 833 const std::string& extension_id) |
834 : event_name(event_name), | 834 : event_name(event_name), |
835 extension_id(extension_id) {} | 835 extension_id(extension_id) {} |
836 | 836 |
837 } // namespace extensions | 837 } // namespace extensions |
OLD | NEW |