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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm

Issue 631163004: Mac - show user manager before opening browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chrome Memory now forces user manager, not Task Manager Created 6 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cocoa/profiles/user_manager_mac.h" 5 #include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #import "chrome/browser/app_controller_mac.h" 9 #import "chrome/browser/app_controller_mac.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 userManagerObserver_->WindowWasClosed(); 159 userManagerObserver_->WindowWasClosed();
160 } 160 }
161 161
162 @end 162 @end
163 163
164 164
165 void UserManager::Show( 165 void UserManager::Show(
166 const base::FilePath& profile_path_to_focus, 166 const base::FilePath& profile_path_to_focus,
167 profiles::UserManagerTutorialMode tutorial_mode, 167 profiles::UserManagerTutorialMode tutorial_mode,
168 profiles::UserManagerProfileSelected profile_open_action) { 168 profiles::UserManagerProfileSelected profile_open_action) {
169 DCHECK(profile_path_to_focus != ProfileManager::GetGuestProfilePath());
170
169 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); 171 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER);
170 if (instance_) { 172 if (instance_) {
171 // If there's a user manager window open already, just activate it. 173 // If there's a user manager window open already, just activate it.
172 [instance_->window_controller() show]; 174 [instance_->window_controller() show];
173 return; 175 return;
174 } 176 }
175 177
176 // Create the guest profile, if necessary, and open the User Manager 178 // Create the guest profile, if necessary, and open the User Manager
177 // from the guest profile. 179 // from the guest profile.
178 profiles::CreateGuestProfileForUserManager( 180 profiles::CreateGuestProfileForUserManager(
(...skipping 25 matching lines...) Expand all
204 const std::string& url) { 206 const std::string& url) {
205 DCHECK(!instance_); 207 DCHECK(!instance_);
206 instance_ = new UserManagerMac(guest_profile); 208 instance_ = new UserManagerMac(guest_profile);
207 [instance_->window_controller() showURL:GURL(url)]; 209 [instance_->window_controller() showURL:GURL(url)];
208 } 210 }
209 211
210 void UserManagerMac::WindowWasClosed() { 212 void UserManagerMac::WindowWasClosed() {
211 instance_ = NULL; 213 instance_ = NULL;
212 delete this; 214 delete this;
213 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698