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

Unified Diff: chrome/browser/user_data_manager.cc

Issue 293013: Deprecate PathService::Get(..., wstring*) and use FilePath instead. (Closed)
Patch Set: Created 11 years, 2 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/user_data_manager.cc
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
index c89abe6573776b883dcbf9046a05c083d7b1d15c..37aa55cde57b6bfd425c6cc22789b6a7b1384684 100644
--- a/chrome/browser/user_data_manager.cc
+++ b/chrome/browser/user_data_manager.cc
@@ -29,6 +29,15 @@
namespace {
+// TODO: don't use wstrings in all this code. :(
Evan Stade 2009/10/19 22:54:31 TODO(evan)
+// But I'm not fixing it right now since this code is reported to be going
+// away.
+void DeprecatedPathServiceGet(int key, std::wstring* str) {
+ FilePath path;
+ PathService::Get(key, &path);
+ *str = path.ToWStringHack();
+}
+
// Helper to start chrome for a given profile index. The helper takes care of
// enumerating profiles on the file thread and then it launches Chrome for the
// appropriate profile on the original thread.
@@ -95,7 +104,7 @@ UserDataManager* UserDataManager::instance_ = NULL;
UserDataManager* UserDataManager::Create() {
DCHECK(!instance_);
std::wstring user_data;
- PathService::Get(chrome::DIR_USER_DATA, &user_data);
+ DeprecatedPathServiceGet(chrome::DIR_USER_DATA, &user_data);
instance_ = new UserDataManager(user_data);
return instance_;
}
@@ -180,13 +189,13 @@ void UserDataManager::LaunchChromeForProfile(
const std::wstring& profile_name) const {
std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name);
std::wstring command;
- PathService::Get(base::FILE_EXE, &command);
+ DeprecatedPathServiceGet(base::FILE_EXE, &command);
CommandLine command_line(command);
command_line.AppendSwitch(switches::kEnableUserDataDirProfiles);
command_line.AppendSwitchWithValue(switches::kUserDataDir,
user_data_dir);
std::wstring local_state_path;
- PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
+ DeprecatedPathServiceGet(chrome::FILE_LOCAL_STATE, &local_state_path);
command_line.AppendSwitchWithValue(switches::kParentProfile,
local_state_path);
base::LaunchApp(command_line, false, false, NULL);

Powered by Google App Engine
This is Rietveld 408576698