| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 case extensions::SOURCE_URL_HANDLER: | 84 case extensions::SOURCE_URL_HANDLER: |
| 85 return app_runtime::LAUNCH_SOURCE_URL_HANDLER; | 85 return app_runtime::LAUNCH_SOURCE_URL_HANDLER; |
| 86 | 86 |
| 87 case extensions::SOURCE_SYSTEM_TRAY: | 87 case extensions::SOURCE_SYSTEM_TRAY: |
| 88 return app_runtime::LAUNCH_SOURCE_SYSTEM_TRAY; | 88 return app_runtime::LAUNCH_SOURCE_SYSTEM_TRAY; |
| 89 case extensions::SOURCE_ABOUT_PAGE: | 89 case extensions::SOURCE_ABOUT_PAGE: |
| 90 return app_runtime::LAUNCH_SOURCE_ABOUT_PAGE; | 90 return app_runtime::LAUNCH_SOURCE_ABOUT_PAGE; |
| 91 case extensions::SOURCE_KEYBOARD: | 91 case extensions::SOURCE_KEYBOARD: |
| 92 return app_runtime::LAUNCH_SOURCE_KEYBOARD; | 92 return app_runtime::LAUNCH_SOURCE_KEYBOARD; |
| 93 | 93 |
| 94 case extensions::SOURCE_SETTINGS_PAGE: |
| 95 return app_runtime::LAUNCH_SOURCE_SETTINGS_PAGE; |
| 96 case extensions::SOURCE_MANAGEMENT_API: |
| 97 return app_runtime::LAUNCH_SOURCE_MANAGEMENT_API; |
| 98 case extensions::SOURCE_EPHEMERAL: |
| 99 return app_runtime::LAUNCH_SOURCE_EPHEMERAL; |
| 100 case extensions::SOURCE_BACKGROUND: |
| 101 return app_runtime::LAUNCH_SOURCE_BACKGROUND; |
| 102 case extensions::SOURCE_KIOSK: |
| 103 return app_runtime::LAUNCH_SOURCE_KIOSK; |
| 104 case extensions::SOURCE_CHROME_INTERNAL: |
| 105 return app_runtime::LAUNCH_SOURCE_CHROME_INTERNAL; |
| 106 |
| 94 default: | 107 default: |
| 95 return app_runtime::LAUNCH_SOURCE_NONE; | 108 return app_runtime::LAUNCH_SOURCE_NONE; |
| 96 } | 109 } |
| 97 } | 110 } |
| 98 | 111 |
| 99 } // namespace | 112 } // namespace |
| 100 | 113 |
| 101 // static | 114 // static |
| 102 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 115 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
| 103 content::BrowserContext* context, | 116 content::BrowserContext* context, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 launch_data.url.reset(new std::string(url.spec())); | 195 launch_data.url.reset(new std::string(url.spec())); |
| 183 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); | 196 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); |
| 184 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { | 197 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { |
| 185 launch_data.source = source_enum; | 198 launch_data.source = source_enum; |
| 186 } | 199 } |
| 187 DispatchOnLaunchedEventImpl( | 200 DispatchOnLaunchedEventImpl( |
| 188 extension->id(), source_enum, launch_data.ToValue().Pass(), context); | 201 extension->id(), source_enum, launch_data.ToValue().Pass(), context); |
| 189 } | 202 } |
| 190 | 203 |
| 191 } // namespace extensions | 204 } // namespace extensions |
| OLD | NEW |