diff options
author | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 12:23:53 +0000 |
---|---|---|
committer | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 12:23:53 +0000 |
commit | e4f864978d24e79ed3a47142c3a146d09627d0d4 (patch) | |
tree | e8f0bf5ef24b7263f448a1b5a853083096249e4b /chrome/browser/app_controller_mac.mm | |
parent | d139f87c7ede1b35c906b32c77e363da4c87bf74 (diff) | |
download | chromium_src-e4f864978d24e79ed3a47142c3a146d09627d0d4.zip chromium_src-e4f864978d24e79ed3a47142c3a146d09627d0d4.tar.gz chromium_src-e4f864978d24e79ed3a47142c3a146d09627d0d4.tar.bz2 |
Revert 81394 (broke sync_integration_tests and clang) - This CL implements alternative asynchronous methods for profile and preferences loading.BUG=chromium-os:11104TEST=UserProfileGotten (see "/tmp/login-times-sent") time doesn't increase, while UI jankness decreases.Review URL: http://codereview.chromium.org/6716025
TBR=altimofeev@chromium.org
Review URL: http://codereview.chromium.org/6834021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 3be6c92..6934219 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -599,17 +599,18 @@ void RecordLastRunAppBundlePath() { if (!profile_manager) return YES; - std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); - for (size_t i = 0; i < profiles.size(); ++i) { - DownloadManager* download_manager = profiles[i]->GetDownloadManager(); + ProfileManager::const_iterator it = profile_manager->begin(); + for (; it != profile_manager->end(); ++it) { + Profile* profile = *it; + DownloadManager* download_manager = profile->GetDownloadManager(); if (download_manager && download_manager->in_progress_count() > 0) { int downloadCount = download_manager->in_progress_count(); if ([self userWillWaitForInProgressDownloads:downloadCount]) { // Create a new browser window (if necessary) and navigate to the // downloads page if the user chooses to wait. - Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); + Browser* browser = BrowserList::FindBrowserWithProfile(profile); if (!browser) { - browser = Browser::Create(profiles[i]); + browser = Browser::Create(profile); browser->window()->Show(); } DCHECK(browser); @@ -983,8 +984,9 @@ void RecordLastRunAppBundlePath() { } - (Profile*)defaultProfile { + // TODO(jrg): Find a better way to get the "default" profile. if (g_browser_process->profile_manager()) - return g_browser_process->profile_manager()->GetDefaultProfile(); + return *g_browser_process->profile_manager()->begin(); return NULL; } |