summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome_main_delegate.cc4
-rw-r--r--chrome/installer/util/auto_launch_util.cc11
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy.cc2
3 files changed, 12 insertions, 5 deletions
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index e25ff4f..c9578a9 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -345,10 +345,8 @@ void InitializeUserDataDir() {
// On Windows, trailing separators leave Chrome in a bad state.
// See crbug.com/464616.
- if (user_data_dir.EndsWithSeparator()) {
+ if (user_data_dir.EndsWithSeparator())
user_data_dir = user_data_dir.StripTrailingSeparators();
- command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
- }
const bool specified_directory_was_invalid = !user_data_dir.empty() &&
!PathService::OverrideAndCreateIfNeeded(chrome::DIR_USER_DATA,
diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc
index 08be65d..5e797ba 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("\"");
}
diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc
index a98fecb..8cfca63 100644
--- a/chrome/service/cloud_print/cloud_print_proxy.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc
@@ -34,6 +34,8 @@ void LaunchBrowserProcessWithSwitch(const std::string& switch_string) {
}
base::CommandLine cmd_line(exe_path);
+ // Propagate an explicit --user-data-dir value if one was given. The new
+ // browser process will pick up a policy override during initialization.
const base::CommandLine& process_command_line =
*base::CommandLine::ForCurrentProcess();
base::FilePath user_data_dir =