| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/api/app_runtime/app_runtime_api.h" | 5 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const Extension* extension) { | 131 const Extension* extension) { |
| 132 DispatchOnEmbedRequestedEventImpl(extension->id(), std::move(embed_app_data), | 132 DispatchOnEmbedRequestedEventImpl(extension->id(), std::move(embed_app_data), |
| 133 context); | 133 context); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // static | 136 // static |
| 137 void AppRuntimeEventRouter::DispatchOnLaunchedEvent( | 137 void AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
| 138 BrowserContext* context, | 138 BrowserContext* context, |
| 139 const Extension* extension, | 139 const Extension* extension, |
| 140 extensions::AppLaunchSource source, | 140 extensions::AppLaunchSource source, |
| 141 std::unique_ptr<app_runtime::ActionData> action_data) { | 141 std::unique_ptr<app_runtime::LaunchData> launch_data) { |
| 142 app_runtime::LaunchData launch_data; | |
| 143 | |
| 144 app_runtime::LaunchSource source_enum = GetLaunchSourceEnum(source); | 142 app_runtime::LaunchSource source_enum = GetLaunchSourceEnum(source); |
| 145 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { | 143 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { |
| 146 launch_data.source = source_enum; | 144 launch_data->source = source_enum; |
| 147 } | 145 } |
| 148 | 146 |
| 149 launch_data.action_data = std::move(action_data); | |
| 150 | |
| 151 DispatchOnLaunchedEventImpl(extension->id(), source_enum, | 147 DispatchOnLaunchedEventImpl(extension->id(), source_enum, |
| 152 launch_data.ToValue(), context); | 148 launch_data->ToValue(), context); |
| 153 } | 149 } |
| 154 | 150 |
| 155 // static | 151 // static |
| 156 void AppRuntimeEventRouter::DispatchOnRestartedEvent( | 152 void AppRuntimeEventRouter::DispatchOnRestartedEvent( |
| 157 BrowserContext* context, | 153 BrowserContext* context, |
| 158 const Extension* extension) { | 154 const Extension* extension) { |
| 159 std::unique_ptr<base::ListValue> arguments(new base::ListValue()); | 155 std::unique_ptr<base::ListValue> arguments(new base::ListValue()); |
| 160 std::unique_ptr<Event> event(new Event(events::APP_RUNTIME_ON_RESTARTED, | 156 std::unique_ptr<Event> event(new Event(events::APP_RUNTIME_ON_RESTARTED, |
| 161 app_runtime::OnRestarted::kEventName, | 157 app_runtime::OnRestarted::kEventName, |
| 162 std::move(arguments))); | 158 std::move(arguments))); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 launch_data.url.reset(new std::string(url.spec())); | 219 launch_data.url.reset(new std::string(url.spec())); |
| 224 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); | 220 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); |
| 225 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { | 221 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { |
| 226 launch_data.source = source_enum; | 222 launch_data.source = source_enum; |
| 227 } | 223 } |
| 228 DispatchOnLaunchedEventImpl(extension->id(), source_enum, | 224 DispatchOnLaunchedEventImpl(extension->id(), source_enum, |
| 229 launch_data.ToValue(), context); | 225 launch_data.ToValue(), context); |
| 230 } | 226 } |
| 231 | 227 |
| 232 } // namespace extensions | 228 } // namespace extensions |
| OLD | NEW |