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

Unified Diff: chrome/installer/util/auto_launch_util.cc

Issue 1010923002: If possible, use the PathService instead of the --user-data-dir flag directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo some changes Created 5 years, 9 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 | « chrome/app/chrome_main_delegate.cc ('k') | chrome/service/cloud_print/cloud_print_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/auto_launch_util.cc
diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc
index 08be65d79deb2cc186c50816433c9f3dad32348a..5e797ba58713e4f7dc78e2207d68066a96d28e12 100644
--- a/chrome/installer/util/auto_launch_util.cc
+++ b/chrome/installer/util/auto_launch_util.cc
@@ -185,12 +185,19 @@ void SetWillLaunchAtLogin(const base::FilePath& application_path,
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
+
+ // Propagate --user-data-dir if it was specified on the command line.
+ // Retrieve the value from the PathService since some sanitation may have
+ // taken place. There is no need to add it to the command line in the
+ // event that the dir was overridden by Group Policy since the GP override
+ // will be in force when Chrome is launched.
if (command_line.HasSwitch(switches::kUserDataDir)) {
cmd_line += ASCIIToUTF16(" --");
cmd_line += ASCIIToUTF16(switches::kUserDataDir);
cmd_line += ASCIIToUTF16("=\"");
- cmd_line +=
- command_line.GetSwitchValuePath(switches::kUserDataDir).value();
+ base::FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
+ cmd_line += user_data_dir.value();
cmd_line += ASCIIToUTF16("\"");
}
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/service/cloud_print/cloud_print_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698