Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: extensions/shell/browser/shell_extension_system.cc

Issue 657023008: Add a new field "source" in launchData of chrome.app.runtime.onLaunched() to trace launch source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/shell/browser/shell_extension_system.h" 5 #include "extensions/shell/browser/shell_extension_system.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/notification_details.h" 13 #include "content/public/browser/notification_details.h"
14 #include "content/public/browser/notification_service.h" 14 #include "content/public/browser/notification_service.h"
15 #include "content/public/browser/notification_source.h" 15 #include "content/public/browser/notification_source.h"
16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" 16 #include "extensions/browser/api/app_runtime/app_runtime_api.h"
17 #include "extensions/browser/event_router.h" 17 #include "extensions/browser/event_router.h"
18 #include "extensions/browser/extension_prefs.h" 18 #include "extensions/browser/extension_prefs.h"
19 #include "extensions/browser/extension_registry.h" 19 #include "extensions/browser/extension_registry.h"
20 #include "extensions/browser/info_map.h" 20 #include "extensions/browser/info_map.h"
21 #include "extensions/browser/lazy_background_task_queue.h" 21 #include "extensions/browser/lazy_background_task_queue.h"
22 #include "extensions/browser/notification_types.h" 22 #include "extensions/browser/notification_types.h"
23 #include "extensions/browser/process_manager.h" 23 #include "extensions/browser/process_manager.h"
24 #include "extensions/browser/quota_service.h" 24 #include "extensions/browser/quota_service.h"
25 #include "extensions/browser/runtime_data.h" 25 #include "extensions/browser/runtime_data.h"
26 #include "extensions/common/constants.h"
26 #include "extensions/common/file_util.h" 27 #include "extensions/common/file_util.h"
27 28
28 using content::BrowserContext; 29 using content::BrowserContext;
29 using content::BrowserThread; 30 using content::BrowserThread;
30 31
31 namespace extensions { 32 namespace extensions {
32 33
33 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context) 34 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context)
34 : browser_context_(browser_context) { 35 : browser_context_(browser_context) {
35 } 36 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 content::NotificationService::current()->Notify( 75 content::NotificationService::current()->Notify(
75 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, 76 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
76 content::Source<BrowserContext>(browser_context_), 77 content::Source<BrowserContext>(browser_context_),
77 content::NotificationService::NoDetails()); 78 content::NotificationService::NoDetails());
78 return true; 79 return true;
79 } 80 }
80 81
81 void ShellExtensionSystem::LaunchApp() { 82 void ShellExtensionSystem::LaunchApp() {
82 // Send the onLaunched event. 83 // Send the onLaunched event.
83 DCHECK(extension_.get()); 84 DCHECK(extension_.get());
84 AppRuntimeEventRouter::DispatchOnLaunchedEvent(browser_context_, 85 AppRuntimeEventRouter::DispatchOnLaunchedEvent(
85 extension_.get()); 86 browser_context_, extension_.get(), extensions::SOURCE_ATHENA);
benwells 2014/10/28 21:22:48 This should probably be SOURCE_UNKNOWN.
cylee1 2014/10/29 16:40:00 Done.
86 } 87 }
87 88
88 void ShellExtensionSystem::Shutdown() { 89 void ShellExtensionSystem::Shutdown() {
89 } 90 }
90 91
91 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { 92 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
92 runtime_data_.reset( 93 runtime_data_.reset(
93 new RuntimeData(ExtensionRegistry::Get(browser_context_))); 94 new RuntimeData(ExtensionRegistry::Get(browser_context_)));
94 lazy_background_task_queue_.reset( 95 lazy_background_task_queue_.reset(
95 new LazyBackgroundTaskQueue(browser_context_)); 96 new LazyBackgroundTaskQueue(browser_context_));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return empty.PassAs<ExtensionSet>(); 193 return empty.PassAs<ExtensionSet>();
193 } 194 }
194 195
195 DeclarativeUserScriptMaster* 196 DeclarativeUserScriptMaster*
196 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension( 197 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension(
197 const ExtensionId& extension_id) { 198 const ExtensionId& extension_id) {
198 return NULL; 199 return NULL;
199 } 200 }
200 201
201 } // namespace extensions 202 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698