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

Unified Diff: chrome/browser/shell_integration.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: 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
Index: chrome/browser/shell_integration.cc
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index 46d749623963117100a5748083cf0edf5074c189..0471c1289053b3c8235700c98f22b77382965d17 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
+#include "base/path_service.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -82,11 +83,10 @@ base::CommandLine ShellIntegration::CommandLineArgsForLauncher(
void ShellIntegration::AppendProfileArgs(const base::FilePath& profile_path,
base::CommandLine* command_line) {
DCHECK(command_line);
- const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
// Use the same UserDataDir for new launches that we currently have set.
- base::FilePath user_data_dir =
- cmd_line.GetSwitchValuePath(switches::kUserDataDir);
+ base::FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
#if defined(OS_MACOSX) || defined(OS_WIN)
policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
grt (UTC plus 2) 2015/03/26 18:36:22 this isn't needed now, is it?
noms (inactive) 2015/03/30 14:06:32 Done.
#endif
@@ -98,6 +98,7 @@ void ShellIntegration::AppendProfileArgs(const base::FilePath& profile_path,
}
#if defined(OS_CHROMEOS)
+ const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
base::FilePath profile = cmd_line.GetSwitchValuePath(
chromeos::switches::kLoginProfile);
if (!profile.empty())

Powered by Google App Engine
This is Rietveld 408576698