Index: chrome/app/chrome_main_delegate.cc |
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc |
index 623b20ab85a362b6a3b67476084389990bc04732..ac205858534837576d36d0588c84c4be7368bd0b 100644 |
--- a/chrome/app/chrome_main_delegate.cc |
+++ b/chrome/app/chrome_main_delegate.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/app/chrome_main_delegate.h" |
#include "base/command_line.h" |
+#include "base/environment.h" |
#include "base/files/file_path.h" |
#include "base/lazy_instance.h" |
#include "base/message_loop/message_loop.h" |
@@ -595,6 +596,13 @@ void ChromeMainDelegate::PreSandboxStartup() { |
// Notice a user data directory override if any |
base::FilePath user_data_dir = |
command_line.GetSwitchValuePath(switches::kUserDataDir); |
+ if (user_data_dir.empty()) { |
+ std::string user_data_dir_string; |
+ scoped_ptr<base::Environment> environment(base::Environment::Create()); |
+ if (environment->GetVar("CHROME_USER_DATA_DIR", &user_data_dir_string) && |
+ IsStringUTF8(user_data_dir_string)) |
+ user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string); |
Wez
2013/08/28 21:06:41
nit: Braces around this, since the condition spans
Jamie
2013/09/09 20:13:00
Done.
|
+ } |
#if defined(OS_MACOSX) || defined(OS_WIN) |
policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); |
#endif |