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

Unified Diff: chrome/browser/background/background_mode_manager.cc

Issue 1439803002: Remove logic for unused foreground auto-launch mode on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d1_rm_auto_launch_trial
Patch Set: Created 5 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
Index: chrome/browser/background/background_mode_manager.cc
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index 49069706fbc64e3e4ec644307f95bafca9631489..439af4ed8f286e7ad0771c7edd241268bea6cd4f 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -66,41 +66,6 @@ using extensions::Extension;
namespace {
-// Records histogram about which auto-launch pattern (if any) was used to launch
-// the current process based on |command_line|.
-void RecordAutoLaunchState(const base::CommandLine& command_line) {
- enum AutoLaunchState {
- AUTO_LAUNCH_NONE = 0,
- AUTO_LAUNCH_BACKGROUND = 1,
- AUTO_LAUNCH_FOREGROUND = 2,
- AUTO_LAUNCH_FOREGROUND_USELESS = 3,
- AUTO_LAUNCH_NUM_STATES
- } auto_launch_state = AUTO_LAUNCH_NONE;
-
- if (command_line.HasSwitch(switches::kNoStartupWindow))
- auto_launch_state = AUTO_LAUNCH_BACKGROUND;
-
- if (command_line.HasSwitch(switches::kAutoLaunchAtStartup)) {
- // The only purpose of kAutoLaunchAtStartup is to override a background
- // auto-launch from kNoStartupWindow into a foreground auto-launch. It's a
- // meaningless switch on its own.
- if (auto_launch_state == AUTO_LAUNCH_BACKGROUND) {
- auto_launch_state = AUTO_LAUNCH_FOREGROUND;
- } else {
- auto_launch_state = AUTO_LAUNCH_FOREGROUND_USELESS;
- }
- }
-
- // Observe the AutoLaunchStates in the wild. According to the platform-
- // specific implementations of EnableLaunchOnStartup(), we'd expect only Mac
- // and Windows to have any sort of AutoLaunchState and only Windows should use
- // FOREGROUND if at all (it was only used by a deprecated experiment and a
- // master pref which may not be used much). Tighten up auto-launch settings
- // based on the result of usage in the wild.
- UMA_HISTOGRAM_ENUMERATION("BackgroundMode.OnStartup.AutoLaunchState",
- auto_launch_state, AUTO_LAUNCH_NUM_STATES);
-}
-
// Enum for recording menu item clicks in UMA.
// NOTE: Do not renumber these as that would confuse interpretation of
// previously logged data. When making changes, also update histograms.xml.
@@ -320,7 +285,8 @@ BackgroundModeManager::BackgroundModeManager(
// are deleted and their names change.
profile_cache_->AddObserver(this);
- RecordAutoLaunchState(command_line);
+ UMA_HISTOGRAM_BOOLEAN("BackgroundMode.OnStartup.AutoLaunchState",
+ command_line.HasSwitch(switches::kNoStartupWindow));
UMA_HISTOGRAM_BOOLEAN("BackgroundMode.OnStartup.IsBackgroundModePrefEnabled",
IsBackgroundModePrefEnabled());

Powered by Google App Engine
This is Rietveld 408576698