OLD | NEW |
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 userManagerObserver_->WindowWasClosed(); | 164 userManagerObserver_->WindowWasClosed(); |
165 } | 165 } |
166 | 166 |
167 @end | 167 @end |
168 | 168 |
169 | 169 |
170 void UserManager::Show( | 170 void UserManager::Show( |
171 const base::FilePath& profile_path_to_focus, | 171 const base::FilePath& profile_path_to_focus, |
172 profiles::UserManagerTutorialMode tutorial_mode, | 172 profiles::UserManagerTutorialMode tutorial_mode, |
173 profiles::UserManagerProfileSelected profile_open_action) { | 173 profiles::UserManagerProfileSelected profile_open_action) { |
| 174 DCHECK(profile_path_to_focus != ProfileManager::GetGuestProfilePath()); |
| 175 |
174 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); | 176 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); |
175 if (instance_) { | 177 if (instance_) { |
176 // If there's a user manager window open already, just activate it. | 178 // If there's a user manager window open already, just activate it. |
177 [instance_->window_controller() show]; | 179 [instance_->window_controller() show]; |
178 return; | 180 return; |
179 } | 181 } |
180 | 182 |
181 // Create the guest profile, if necessary, and open the User Manager | 183 // Create the guest profile, if necessary, and open the User Manager |
182 // from the guest profile. | 184 // from the guest profile. |
183 profiles::CreateGuestProfileForUserManager( | 185 profiles::CreateGuestProfileForUserManager( |
(...skipping 25 matching lines...) Expand all Loading... |
209 const std::string& url) { | 211 const std::string& url) { |
210 DCHECK(!instance_); | 212 DCHECK(!instance_); |
211 instance_ = new UserManagerMac(guest_profile); | 213 instance_ = new UserManagerMac(guest_profile); |
212 [instance_->window_controller() showURL:GURL(url)]; | 214 [instance_->window_controller() showURL:GURL(url)]; |
213 } | 215 } |
214 | 216 |
215 void UserManagerMac::WindowWasClosed() { | 217 void UserManagerMac::WindowWasClosed() { |
216 instance_ = NULL; | 218 instance_ = NULL; |
217 delete this; | 219 delete this; |
218 } | 220 } |
OLD | NEW |