Commit b04aeaec authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Fix DCHECK when migrating task bar shortcuts.

MigrateShortcutsInPathInternal uses the command line within a task bar
pin to determine the pin's expected AppId. If the command line in the
shortcut contains "--user-data-dir" without a value, Chrome itself
ignores the switch and uses the default. This change does the same for
the AppId calculation in MigrateShortcutsInPathInternal.

BUG=1045019
R=gab@chromium.org

Change-Id: Ia337c6d0d30fed1525e97e341b0ae4b0e5edef15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022788Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735400}
parent 0617ad77
...@@ -111,10 +111,10 @@ base::string16 GetExpectedAppId(const base::CommandLine& command_line, ...@@ -111,10 +111,10 @@ base::string16 GetExpectedAppId(const base::CommandLine& command_line,
base::FilePath user_data_dir; base::FilePath user_data_dir;
if (command_line.HasSwitch(switches::kUserDataDir)) if (command_line.HasSwitch(switches::kUserDataDir))
user_data_dir = command_line.GetSwitchValuePath(switches::kUserDataDir); user_data_dir = command_line.GetSwitchValuePath(switches::kUserDataDir);
else
chrome::GetDefaultUserDataDirectory(&user_data_dir);
// Adjust with any policy that overrides any other way to set the path. // Adjust with any policy that overrides any other way to set the path.
policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
if (user_data_dir.empty())
chrome::GetDefaultUserDataDirectory(&user_data_dir);
DCHECK(!user_data_dir.empty()); DCHECK(!user_data_dir.empty());
base::FilePath profile_subdir; base::FilePath profile_subdir;
......
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