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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 222313005: [Profiles] Download high-res avatars using the --new-profile-management flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 6 years, 7 months 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) 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 bool StartupBrowserCreator::LaunchBrowser( 267 bool StartupBrowserCreator::LaunchBrowser(
268 const CommandLine& command_line, 268 const CommandLine& command_line,
269 Profile* profile, 269 Profile* profile,
270 const base::FilePath& cur_dir, 270 const base::FilePath& cur_dir,
271 chrome::startup::IsProcessStartup process_startup, 271 chrome::startup::IsProcessStartup process_startup,
272 chrome::startup::IsFirstRun is_first_run, 272 chrome::startup::IsFirstRun is_first_run,
273 int* return_code) { 273 int* return_code) {
274 274
275 // If needed, start downloading the high-res avatar.
msw 2014/04/28 20:46:37 Is this actually needed on browser launch? Is ther
noms (inactive) 2014/04/29 19:12:27 You're right, now that the ProfileInfoCache can cr
276 if (switches::IsNewAvatarMenu()) {
277 ProfileInfoCache& cache =
278 g_browser_process->profile_manager()->GetProfileInfoCache();
279 size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
280 size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(profile_index);
281 profiles::DownloadHighResAvatarIfNeeded(icon_index);
282 }
283
275 in_synchronous_profile_launch_ = 284 in_synchronous_profile_launch_ =
276 process_startup == chrome::startup::IS_PROCESS_STARTUP; 285 process_startup == chrome::startup::IS_PROCESS_STARTUP;
277 DCHECK(profile); 286 DCHECK(profile);
278 287
279 // Continue with the incognito profile from here on if Incognito mode 288 // Continue with the incognito profile from here on if Incognito mode
280 // is forced. 289 // is forced.
281 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, 290 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line,
282 profile->GetPrefs())) { 291 profile->GetPrefs())) {
283 profile = profile->GetOffTheRecordProfile(); 292 profile = profile->GetOffTheRecordProfile();
284 } else if (command_line.HasSwitch(switches::kIncognito)) { 293 } else if (command_line.HasSwitch(switches::kIncognito)) {
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 734 }
726 735
727 if (command_line.HasSwitch(switches::kProfileDirectory)) { 736 if (command_line.HasSwitch(switches::kProfileDirectory)) {
728 return user_data_dir.Append( 737 return user_data_dir.Append(
729 command_line.GetSwitchValuePath(switches::kProfileDirectory)); 738 command_line.GetSwitchValuePath(switches::kProfileDirectory));
730 } 739 }
731 740
732 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 741 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
733 user_data_dir); 742 user_data_dir);
734 } 743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698