OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/user_data_manager.h" | 7 #include "chrome/browser/user_data_manager.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 file_util::AppendToPath(&folder_path, folder_name); | 175 file_util::AppendToPath(&folder_path, folder_name); |
176 return folder_path; | 176 return folder_path; |
177 } | 177 } |
178 | 178 |
179 void UserDataManager::LaunchChromeForProfile( | 179 void UserDataManager::LaunchChromeForProfile( |
180 const std::wstring& profile_name) const { | 180 const std::wstring& profile_name) const { |
181 std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name); | 181 std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name); |
182 std::wstring command; | 182 std::wstring command; |
183 PathService::Get(base::FILE_EXE, &command); | 183 PathService::Get(base::FILE_EXE, &command); |
184 CommandLine command_line(command); | 184 CommandLine command_line(command); |
| 185 command_line.AppendSwitch(switches::kEnableUserDataDirProfiles); |
185 command_line.AppendSwitchWithValue(switches::kUserDataDir, | 186 command_line.AppendSwitchWithValue(switches::kUserDataDir, |
186 user_data_dir); | 187 user_data_dir); |
187 std::wstring local_state_path; | 188 std::wstring local_state_path; |
188 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 189 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
189 command_line.AppendSwitchWithValue(switches::kParentProfile, | 190 command_line.AppendSwitchWithValue(switches::kParentProfile, |
190 local_state_path); | 191 local_state_path); |
191 base::LaunchApp(command_line, false, false, NULL); | 192 base::LaunchApp(command_line, false, false, NULL); |
192 } | 193 } |
193 | 194 |
194 void UserDataManager::LaunchChromeForProfile(int index) const { | 195 void UserDataManager::LaunchChromeForProfile(int index) const { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 &GetProfilesHelper::InvokeDelegate, | 302 &GetProfilesHelper::InvokeDelegate, |
302 profiles.release())); | 303 profiles.release())); |
303 } | 304 } |
304 | 305 |
305 void GetProfilesHelper::InvokeDelegate(std::vector<std::wstring>* profiles) { | 306 void GetProfilesHelper::InvokeDelegate(std::vector<std::wstring>* profiles) { |
306 scoped_ptr< std::vector<std::wstring> > udd_profiles(profiles); | 307 scoped_ptr< std::vector<std::wstring> > udd_profiles(profiles); |
307 // If the delegate is gone by now, no need to do any work. | 308 // If the delegate is gone by now, no need to do any work. |
308 if (delegate_) | 309 if (delegate_) |
309 delegate_->OnGetProfilesDone(*udd_profiles.get()); | 310 delegate_->OnGetProfilesDone(*udd_profiles.get()); |
310 } | 311 } |
OLD | NEW |