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

Unified Diff: apps/app_load_service.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: fix typo Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_load_service.h ('k') | apps/launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_load_service.cc
diff --git a/apps/app_load_service.cc b/apps/app_load_service.cc
index 6fff4c4ef4bb7865ba8db53e59a1416dc63b5ea0..8f22422f6b632eb37c563d55202dd861be570076 100644
--- a/apps/app_load_service.cc
+++ b/apps/app_load_service.cc
@@ -28,7 +28,7 @@ using extensions::ExtensionSystem;
namespace apps {
AppLoadService::PostReloadAction::PostReloadAction()
- : action_type(LAUNCH),
+ : action_type(LAUNCH_FOR_RELOAD),
command_line(base::CommandLine::NO_PROGRAM) {
}
@@ -71,7 +71,7 @@ bool AppLoadService::LoadAndLaunch(const base::FilePath& extension_path,
// Schedule the app to be launched once loaded.
PostReloadAction& action = post_reload_actions_[extension_id];
- action.action_type = LAUNCH_WITH_COMMAND_LINE;
+ action.action_type = LAUNCH_FOR_LOAD_AND_LAUNCH;
action.command_line = command_line;
action.current_dir = current_dir;
return true;
@@ -98,15 +98,18 @@ void AppLoadService::Observe(int type,
return;
switch (it->second.action_type) {
- case LAUNCH:
- LaunchPlatformApp(profile_, extension);
+ case LAUNCH_FOR_RELOAD:
+ LaunchPlatformApp(profile_, extension, extensions::SOURCE_RELOAD);
break;
case RESTART:
RestartPlatformApp(profile_, extension);
break;
- case LAUNCH_WITH_COMMAND_LINE:
- LaunchPlatformAppWithCommandLine(
- profile_, extension, it->second.command_line, it->second.current_dir);
+ case LAUNCH_FOR_LOAD_AND_LAUNCH:
+ LaunchPlatformAppWithCommandLine(profile_,
+ extension,
+ it->second.command_line,
+ it->second.current_dir,
+ extensions::SOURCE_LOAD_AND_LAUNCH);
break;
default:
NOTREACHED();
@@ -127,7 +130,7 @@ void AppLoadService::OnExtensionUnloaded(
if (WasUnloadedForReload(extension->id(), reason) &&
extension_prefs->IsActive(extension->id()) &&
!HasPostReloadAction(extension->id())) {
- post_reload_actions_[extension->id()].action_type = LAUNCH;
+ post_reload_actions_[extension->id()].action_type = LAUNCH_FOR_RELOAD;
}
}
« no previous file with comments | « apps/app_load_service.h ('k') | apps/launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698