| 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" |
| 11 #include "extensions/browser/extension_prefs.h" | 11 #include "extensions/browser/extension_prefs.h" |
| 12 #include "extensions/browser/extensions_browser_client.h" | 12 #include "extensions/browser/extensions_browser_client.h" |
| 13 #include "extensions/browser/granted_file_entry.h" | 13 #include "extensions/browser/granted_file_entry.h" |
| 14 #include "extensions/common/api/app_runtime.h" | 14 #include "extensions/common/api/app_runtime.h" |
| 15 #include "extensions/common/constants.h" | 15 #include "extensions/common/constants.h" |
| 16 #include "extensions/common/feature_switch.h" | 16 #include "extensions/common/feature_switch.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 using content::BrowserContext; | 19 using content::BrowserContext; |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 | 22 |
| 23 namespace app_runtime = core_api::app_runtime; | 23 namespace app_runtime = api::app_runtime; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 void DispatchOnEmbedRequestedEventImpl( | 27 void DispatchOnEmbedRequestedEventImpl( |
| 28 const std::string& extension_id, | 28 const std::string& extension_id, |
| 29 scoped_ptr<base::DictionaryValue> app_embedding_request_data, | 29 scoped_ptr<base::DictionaryValue> app_embedding_request_data, |
| 30 content::BrowserContext* context) { | 30 content::BrowserContext* context) { |
| 31 scoped_ptr<base::ListValue> args(new base::ListValue()); | 31 scoped_ptr<base::ListValue> args(new base::ListValue()); |
| 32 args->Append(app_embedding_request_data.release()); | 32 args->Append(app_embedding_request_data.release()); |
| 33 scoped_ptr<Event> event(new Event(events::APP_RUNTIME_ON_EMBED_REQUESTED, | 33 scoped_ptr<Event> event(new Event(events::APP_RUNTIME_ON_EMBED_REQUESTED, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 launch_data.url.reset(new std::string(url.spec())); | 196 launch_data.url.reset(new std::string(url.spec())); |
| 197 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); | 197 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); |
| 198 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { | 198 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { |
| 199 launch_data.source = source_enum; | 199 launch_data.source = source_enum; |
| 200 } | 200 } |
| 201 DispatchOnLaunchedEventImpl( | 201 DispatchOnLaunchedEventImpl( |
| 202 extension->id(), source_enum, launch_data.ToValue().Pass(), context); | 202 extension->id(), source_enum, launch_data.ToValue().Pass(), context); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace extensions | 205 } // namespace extensions |
| OLD | NEW |