summaryrefslogtreecommitdiffstats
path: root/chrome/browser/user_data_manager.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 22:54:41 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 22:54:41 +0000
commitab926d553d2fbab7f170826afa811a253a8a65c8 (patch)
tree76c577b278544269f2ee04412b9661528d57856e /chrome/browser/user_data_manager.cc
parent02e60209512e8013f962d33c0916613b796cad84 (diff)
downloadchromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.zip
chromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.tar.gz
chromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.tar.bz2
Deprecate PathService::Get(..., wstring*) and use FilePath instead.
I tried fixing all the Windows code but there's a *ton* of it. This change will at least prevent people from adding new code that uses the deprecated version (as that won't compile on Lin/Mac). BUG=24672 Review URL: http://codereview.chromium.org/293013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/user_data_manager.cc')
-rw-r--r--chrome/browser/user_data_manager.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
index c89abe6..37aa55c 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. :(
+// 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);