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/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: Move ProfileLocked check. Add unit test. Created 5 years, 11 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 695
696 // Guest or locked profiles cannot be re-opened on startup. The only 696 // Guest or locked profiles cannot be re-opened on startup. The only
697 // exception is if there's already a Guest window open in a separate 697 // exception is if there's already a Guest window open in a separate
698 // process (for example, launching a new browser after clicking on a 698 // process (for example, launching a new browser after clicking on a
699 // downloaded file in Guest mode). 699 // downloaded file in Guest mode).
700 bool has_guest_browsers = last_used_profile->IsGuestSession() && 700 bool has_guest_browsers = last_used_profile->IsGuestSession() &&
701 chrome::GetTotalBrowserCountForProfile( 701 chrome::GetTotalBrowserCountForProfile(
702 last_used_profile->GetOffTheRecordProfile()) > 0; 702 last_used_profile->GetOffTheRecordProfile()) > 0;
703 if (signin_required || 703 if (signin_required ||
704 (last_used_profile->IsGuestSession() && !has_guest_browsers)) { 704 (last_used_profile->IsGuestSession() && !has_guest_browsers)) {
705 UserManager::Show(base::FilePath(), 705 profiles::UserManagerProfileSelected action =
706 profiles::USER_MANAGER_NO_TUTORIAL, 706 command_line.HasSwitch(switches::kShowAppList) ?
707 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); 707 profiles::USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER :
708 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION;
709 UserManager::Show(
710 base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, action);
708 return true; 711 return true;
709 } 712 }
710 } 713 }
711 714
712 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A"; 715 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A";
713 Profile* profile_to_open = last_used_profile->IsGuestSession() ? 716 Profile* profile_to_open = last_used_profile->IsGuestSession() ?
714 last_used_profile->GetOffTheRecordProfile() : last_used_profile; 717 last_used_profile->GetOffTheRecordProfile() : last_used_profile;
715 718
716 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A"; 719 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A";
717 if (!browser_creator->LaunchBrowser(command_line, profile_to_open, 720 if (!browser_creator->LaunchBrowser(command_line, profile_to_open,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 // If we are showing the app list then chrome isn't shown so load the app 861 // If we are showing the app list then chrome isn't shown so load the app
859 // list's profile rather than chrome's. 862 // list's profile rather than chrome's.
860 if (command_line.HasSwitch(switches::kShowAppList)) { 863 if (command_line.HasSwitch(switches::kShowAppList)) {
861 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> 864 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
862 GetProfilePath(user_data_dir); 865 GetProfilePath(user_data_dir);
863 } 866 }
864 867
865 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 868 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
866 user_data_dir); 869 user_data_dir);
867 } 870 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698