OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 bool StartupBrowserCreator::LaunchBrowser( | 271 bool StartupBrowserCreator::LaunchBrowser( |
272 const CommandLine& command_line, | 272 const CommandLine& command_line, |
273 Profile* profile, | 273 Profile* profile, |
274 const base::FilePath& cur_dir, | 274 const base::FilePath& cur_dir, |
275 chrome::startup::IsProcessStartup process_startup, | 275 chrome::startup::IsProcessStartup process_startup, |
276 chrome::startup::IsFirstRun is_first_run, | 276 chrome::startup::IsFirstRun is_first_run, |
277 int* return_code) { | 277 int* return_code) { |
278 | 278 |
| 279 // If needed, start dowloading the high-res avatar. |
| 280 if (switches::IsNewProfileManagement()) { |
| 281 ProfileInfoCache& cache = |
| 282 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 283 size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 284 size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(profile_index); |
| 285 profiles::DownloadHighResAvatarIfNeeded(icon_index); |
| 286 } |
| 287 |
279 in_synchronous_profile_launch_ = | 288 in_synchronous_profile_launch_ = |
280 process_startup == chrome::startup::IS_PROCESS_STARTUP; | 289 process_startup == chrome::startup::IS_PROCESS_STARTUP; |
281 DCHECK(profile); | 290 DCHECK(profile); |
282 | 291 |
283 // Continue with the incognito profile from here on if Incognito mode | 292 // Continue with the incognito profile from here on if Incognito mode |
284 // is forced. | 293 // is forced. |
285 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, | 294 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, |
286 profile->GetPrefs())) { | 295 profile->GetPrefs())) { |
287 profile = profile->GetOffTheRecordProfile(); | 296 profile = profile->GetOffTheRecordProfile(); |
288 } else if (command_line.HasSwitch(switches::kIncognito)) { | 297 } else if (command_line.HasSwitch(switches::kIncognito)) { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 748 } |
740 | 749 |
741 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 750 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
742 return user_data_dir.Append( | 751 return user_data_dir.Append( |
743 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 752 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
744 } | 753 } |
745 | 754 |
746 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 755 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
747 user_data_dir); | 756 user_data_dir); |
748 } | 757 } |
OLD | NEW |