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

Side by Side Diff: chrome/browser/user_data_manager.cc

Issue 13315: Move file enumeration to filepaths. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/user_data_manager.h" 5 #include "chrome/browser/user_data_manager.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Helper deletes itself when done. 198 // Helper deletes itself when done.
199 LaunchChromeForProfileIndexHelper* helper = 199 LaunchChromeForProfileIndexHelper* helper =
200 new LaunchChromeForProfileIndexHelper(this, index); 200 new LaunchChromeForProfileIndexHelper(this, index);
201 helper->StartLaunch(); 201 helper->StartLaunch();
202 } 202 }
203 203
204 void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const { 204 void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const {
205 // This function should be called on the file thread. 205 // This function should be called on the file thread.
206 DCHECK(MessageLoop::current() == 206 DCHECK(MessageLoop::current() ==
207 ChromeThread::GetMessageLoop(ChromeThread::FILE)); 207 ChromeThread::GetMessageLoop(ChromeThread::FILE));
208 file_util::FileEnumerator file_enum(user_data_root_, 208 file_util::FileEnumerator file_enum(
209 false, 209 FilePath::FromWStringHack(user_data_root_),
210 file_util::FileEnumerator::DIRECTORIES); 210 false, file_util::FileEnumerator::DIRECTORIES);
211 std::wstring folder_name; 211 std::wstring folder_name;
212 while (!(folder_name = file_enum.Next()).empty()) { 212 while (!(folder_name = file_enum.Next().ToWStringHack()).empty()) {
213 folder_name = file_util::GetFilenameFromPath(folder_name); 213 folder_name = file_util::GetFilenameFromPath(folder_name);
214 std::wstring profile_name; 214 std::wstring profile_name;
215 if (GetProfileNameFromFolderName(folder_name, &profile_name)) 215 if (GetProfileNameFromFolderName(folder_name, &profile_name))
216 profiles->push_back(profile_name); 216 profiles->push_back(profile_name);
217 } 217 }
218 } 218 }
219 219
220 bool UserDataManager::CreateDesktopShortcutForProfile( 220 bool UserDataManager::CreateDesktopShortcutForProfile(
221 const std::wstring& profile_name) const { 221 const std::wstring& profile_name) const {
222 std::wstring exe_path; 222 std::wstring exe_path;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 &GetProfilesHelper::InvokeDelegate, 298 &GetProfilesHelper::InvokeDelegate,
299 profiles.release())); 299 profiles.release()));
300 } 300 }
301 301
302 void GetProfilesHelper::InvokeDelegate(std::vector<std::wstring>* profiles) { 302 void GetProfilesHelper::InvokeDelegate(std::vector<std::wstring>* profiles) {
303 scoped_ptr< std::vector<std::wstring> > udd_profiles(profiles); 303 scoped_ptr< std::vector<std::wstring> > udd_profiles(profiles);
304 // If the delegate is gone by now, no need to do any work. 304 // If the delegate is gone by now, no need to do any work.
305 if (delegate_) 305 if (delegate_)
306 delegate_->OnGetProfilesDone(*udd_profiles.get()); 306 delegate_->OnGetProfilesDone(*udd_profiles.get());
307 } 307 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_unittest.cc ('k') | net/base/directory_lister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698