Commit 6d17cf58 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Fix startup performance metrics for the ProfilePicker

The startup performance metrics were recorded when Chrome is restored
from background. This was not intedended, as these metrics were designed
to measure only startup performance.

Bug: 1141011
Change-Id: I20e1ff5f634d2a629349e34f7ced4f0cf2c5b790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2489919
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarTommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821203}
parent 79bf7bd2
......@@ -23,7 +23,10 @@ class ProfilePicker {
kProfileMenuManageProfiles = 1,
kProfileMenuAddNewProfile = 2,
kOpenNewWindowAfterProfileDeletion = 3,
kMaxValue = kOpenNewWindowAfterProfileDeletion,
// A new session was sarted while Chrome was already running (e.g. by
// clicking on the tray icon on Windows).
kNewSessionOnExistingProcess = 4,
kMaxValue = kNewSessionOnExistingProcess,
};
// Shows the Profile picker for the given `entry_point` or re-activates an
......
......@@ -898,7 +898,10 @@ bool StartupBrowserCreator::LaunchBrowserForLastProfiles(
StartupBrowserCreator::GetURLsFromCommandLine(command_line, cur_dir,
last_used_profile);
if (ShouldShowProfilePicker(command_line, urls_to_launch)) {
ProfilePicker::Show(ProfilePicker::EntryPoint::kOnStartup);
ProfilePicker::Show(
process_startup
? ProfilePicker::EntryPoint::kOnStartup
: ProfilePicker::EntryPoint::kNewSessionOnExistingProcess);
return true;
}
#endif // !defined(OS_CHROMEOS)
......
......@@ -71,6 +71,7 @@ GURL CreateURLForEntryPoint(ProfilePicker::EntryPoint entry_point) {
}
case ProfilePicker::EntryPoint::kProfileMenuManageProfiles:
case ProfilePicker::EntryPoint::kOpenNewWindowAfterProfileDeletion:
case ProfilePicker::EntryPoint::kNewSessionOnExistingProcess:
return base_url;
case ProfilePicker::EntryPoint::kProfileMenuAddNewProfile:
return base_url.Resolve("new-profile");
......
......@@ -60358,6 +60358,7 @@ https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_2.7.1.pdf
<int value="1" label="Manage profile button in the profile menu"/>
<int value="2" label="Add new profile button in the profile menu"/>
<int value="3" label="Open new window after profile deletion"/>
<int value="4" label="New session while running (e.g. from Windows tray)"/>
</enum>
<enum name="ProfilePickerPages">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment