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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 2902963002: Add a new LaunchMode value for launches from a user experiment. (Closed)
Patch Set: pk feedback Created 3 years, 7 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
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | tools/metrics/histograms/enums.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index cf539f3c629457eed8fc277ec668a758e5fcee5a..6d90f139456dab304ad87f3aba7f127c59351fa9 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -133,16 +133,17 @@ namespace {
// Utility functions ----------------------------------------------------------
enum LaunchMode {
- LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut.
- LM_AS_WEBAPP, // Launched as a installed web application.
- LM_WITH_URLS, // Launched with urls in the cmd line.
- LM_SHORTCUT_NONE, // Not launched from a shortcut.
- LM_SHORTCUT_NONAME, // Launched from shortcut but no name available.
- LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut.
- LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar.
- LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut.
- LM_SHORTCUT_TASKBAR, // Launched from the taskbar.
- LM_LINUX_MAC_BEOS // Other OS buckets start here.
+ LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut.
+ LM_AS_WEBAPP, // Launched as a installed web application.
+ LM_WITH_URLS, // Launched with urls in the cmd line.
+ LM_SHORTCUT_NONE, // Not launched from a shortcut.
+ LM_SHORTCUT_NONAME, // Launched from shortcut but no name available.
+ LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut.
+ LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar.
+ LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut.
+ LM_SHORTCUT_TASKBAR, // Launched from the taskbar.
+ LM_USER_EXPERIMENT, // Launched after acceptance of a user experiment.
+ LM_LINUX_MAC_BEOS // Other OS buckets start here.
};
#if defined(OS_WIN)
@@ -340,7 +341,8 @@ StartupBrowserCreatorImpl::~StartupBrowserCreatorImpl() {
bool StartupBrowserCreatorImpl::Launch(Profile* profile,
const std::vector<GURL>& urls_to_open,
bool process_startup) {
- UMA_HISTOGRAM_COUNTS_100("Startup.BrowserLaunchURLCount",
+ UMA_HISTOGRAM_COUNTS_100(
+ "Startup.BrowserLaunchURLCount",
static_cast<base::HistogramBase::Sample>(urls_to_open.size()));
RecordRapporOnStartupURLs(urls_to_open);
@@ -377,8 +379,13 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
if (OpenApplicationWindow(profile)) {
RecordLaunchModeHistogram(LM_AS_WEBAPP);
} else {
- RecordLaunchModeHistogram(urls_to_open.empty() ?
- LM_TO_BE_DECIDED : LM_WITH_URLS);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kTryChromeAgain)) {
+ RecordLaunchModeHistogram(LM_USER_EXPERIMENT);
+ } else {
+ RecordLaunchModeHistogram(urls_to_open.empty() ? LM_TO_BE_DECIDED
+ : LM_WITH_URLS);
+ }
if (StartupBrowserCreator::UseConsolidatedFlow())
ProcessLaunchUrlsUsingConsolidatedFlow(process_startup, urls_to_open);
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | tools/metrics/histograms/enums.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698