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

Unified Diff: chrome/browser/ui/extensions/application_launch.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/application_launch.cc
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 74ce425b27a4c7a6b53dae6f9dbbeb69348873bd..a09cac83c3672bcab22daf63035dce2258640b73 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -8,6 +8,7 @@
#include "apps/launcher.h"
#include "base/command_line.h"
+#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
@@ -302,8 +303,13 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) {
PerAppSettingsServiceFactory::GetForBrowserContext(profile)->
SetDesktopLastLaunchedFrom(extension->id(), params.desktop_type);
- apps::LaunchPlatformAppWithCommandLine(
- profile, extension, params.command_line, params.current_directory);
+ VLOG(2) << "Launch source: " << params.source;
benwells 2014/10/28 21:22:47 Please remove before landing.
cylee1 2014/10/29 16:39:59 Done.
+
+ apps::LaunchPlatformAppWithCommandLine(profile,
+ extension,
+ params.command_line,
+ params.current_directory,
+ params.source);
return NULL;
}
@@ -344,7 +350,9 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
desktop_type(chrome::GetActiveDesktop()),
override_url(),
override_bounds(),
- command_line(CommandLine::NO_PROGRAM) {}
+ command_line(CommandLine::NO_PROGRAM),
+ source(extensions::SOURCE_UNKNOWN) {
benwells 2014/10/28 21:22:47 Do you have any idea how many instances of launchi
cylee1 2014/10/29 16:39:59 I've checked all calls to OpenApplication (https:/
benwells 2014/10/30 06:04:28 I am OK with starting like this, but I think you'v
cylee1 2014/10/30 13:03:43 In my proposal document I've listed a bunch of sou
cylee1 2014/10/31 06:37:53 I got what you mean, but I think it's fine to chan
+}
AppLaunchParams::AppLaunchParams(Profile* profile,
const extensions::Extension* extension,
@@ -356,7 +364,8 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
desktop_type(chrome::GetActiveDesktop()),
override_url(),
override_bounds(),
- command_line(CommandLine::NO_PROGRAM) {
+ command_line(CommandLine::NO_PROGRAM),
+ source(extensions::SOURCE_UNKNOWN) {
// Look up the app preference to find out the right launch container. Default
// is to launch as a regular tab.
container =
@@ -374,7 +383,8 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
desktop_type(desktop_type),
override_url(),
override_bounds(),
- command_line(CommandLine::NO_PROGRAM) {
+ command_line(CommandLine::NO_PROGRAM),
+ source(extensions::SOURCE_UNKNOWN) {
if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
container = extensions::LAUNCH_CONTAINER_TAB;
} else if (disposition == NEW_WINDOW) {

Powered by Google App Engine
This is Rietveld 408576698