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 "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "extensions/browser/event_router.h" | 10 #include "extensions/browser/event_router.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 case extensions::SOURCE_MANAGEMENT_API: | 94 case extensions::SOURCE_MANAGEMENT_API: |
95 return app_runtime::LAUNCH_SOURCE_MANAGEMENT_API; | 95 return app_runtime::LAUNCH_SOURCE_MANAGEMENT_API; |
96 case extensions::SOURCE_EPHEMERAL_APP: | 96 case extensions::SOURCE_EPHEMERAL_APP: |
97 return app_runtime::LAUNCH_SOURCE_EPHEMERAL_APP; | 97 return app_runtime::LAUNCH_SOURCE_EPHEMERAL_APP; |
98 case extensions::SOURCE_BACKGROUND: | 98 case extensions::SOURCE_BACKGROUND: |
99 return app_runtime::LAUNCH_SOURCE_BACKGROUND; | 99 return app_runtime::LAUNCH_SOURCE_BACKGROUND; |
100 case extensions::SOURCE_KIOSK: | 100 case extensions::SOURCE_KIOSK: |
101 return app_runtime::LAUNCH_SOURCE_KIOSK; | 101 return app_runtime::LAUNCH_SOURCE_KIOSK; |
102 case extensions::SOURCE_CHROME_INTERNAL: | 102 case extensions::SOURCE_CHROME_INTERNAL: |
103 return app_runtime::LAUNCH_SOURCE_CHROME_INTERNAL; | 103 return app_runtime::LAUNCH_SOURCE_CHROME_INTERNAL; |
| 104 case extensions::SOURCE_TEST: |
| 105 return app_runtime::LAUNCH_SOURCE_TEST; |
104 | 106 |
105 default: | 107 default: |
106 return app_runtime::LAUNCH_SOURCE_NONE; | 108 return app_runtime::LAUNCH_SOURCE_NONE; |
107 } | 109 } |
108 } | 110 } |
109 | 111 |
110 } // namespace | 112 } // namespace |
111 | 113 |
112 // static | 114 // static |
113 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 115 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 launch_data.url.reset(new std::string(url.spec())); | 195 launch_data.url.reset(new std::string(url.spec())); |
194 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); | 196 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); |
195 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { | 197 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { |
196 launch_data.source = source_enum; | 198 launch_data.source = source_enum; |
197 } | 199 } |
198 DispatchOnLaunchedEventImpl( | 200 DispatchOnLaunchedEventImpl( |
199 extension->id(), source_enum, launch_data.ToValue().Pass(), context); | 201 extension->id(), source_enum, launch_data.ToValue().Pass(), context); |
200 } | 202 } |
201 | 203 |
202 } // namespace extensions | 204 } // namespace extensions |
OLD | NEW |