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

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

Issue 856733004: Loading the Launcher with a Locked Profile launched UserManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tapted@: test fixes and remove a const-ref. Created 5 years, 10 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
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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 690
691 // Guest or locked profiles cannot be re-opened on startup. The only 691 // Guest or locked profiles cannot be re-opened on startup. The only
692 // exception is if there's already a Guest window open in a separate 692 // exception is if there's already a Guest window open in a separate
693 // process (for example, launching a new browser after clicking on a 693 // process (for example, launching a new browser after clicking on a
694 // downloaded file in Guest mode). 694 // downloaded file in Guest mode).
695 bool has_guest_browsers = last_used_profile->IsGuestSession() && 695 bool has_guest_browsers = last_used_profile->IsGuestSession() &&
696 chrome::GetTotalBrowserCountForProfile( 696 chrome::GetTotalBrowserCountForProfile(
697 last_used_profile->GetOffTheRecordProfile()) > 0; 697 last_used_profile->GetOffTheRecordProfile()) > 0;
698 if (signin_required || 698 if (signin_required ||
699 (last_used_profile->IsGuestSession() && !has_guest_browsers)) { 699 (last_used_profile->IsGuestSession() && !has_guest_browsers)) {
700 UserManager::Show(base::FilePath(), 700 profiles::UserManagerProfileSelected action =
701 profiles::USER_MANAGER_NO_TUTORIAL, 701 command_line.HasSwitch(switches::kShowAppList) ?
702 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); 702 profiles::USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER :
703 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION;
704 UserManager::Show(
705 base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, action);
703 return true; 706 return true;
704 } 707 }
705 } 708 }
706 709
707 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A"; 710 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A";
708 Profile* profile_to_open = last_used_profile->IsGuestSession() ? 711 Profile* profile_to_open = last_used_profile->IsGuestSession() ?
709 last_used_profile->GetOffTheRecordProfile() : last_used_profile; 712 last_used_profile->GetOffTheRecordProfile() : last_used_profile;
710 713
711 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A"; 714 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A";
712 if (!browser_creator->LaunchBrowser(command_line, profile_to_open, 715 if (!browser_creator->LaunchBrowser(command_line, profile_to_open,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 // If we are showing the app list then chrome isn't shown so load the app 856 // If we are showing the app list then chrome isn't shown so load the app
854 // list's profile rather than chrome's. 857 // list's profile rather than chrome's.
855 if (command_line.HasSwitch(switches::kShowAppList)) { 858 if (command_line.HasSwitch(switches::kShowAppList)) {
856 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> 859 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
857 GetProfilePath(user_data_dir); 860 GetProfilePath(user_data_dir);
858 } 861 }
859 862
860 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 863 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
861 user_data_dir); 864 user_data_dir);
862 } 865 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698