| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()); | 174 DCHECK(profile_path_to_focus != ProfileManager::GetGuestProfilePath()); |
| 175 | 175 |
| 176 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); | 176 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::OPEN_USER_MANAGER); |
| 177 if (instance_) { | 177 if (instance_) { |
| 178 // 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. |
| 179 [instance_->window_controller() show]; | 179 [instance_->window_controller() show]; |
| 180 return; | 180 return; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Create the guest profile, if necessary, and open the User Manager | 183 // Create the guest profile, if necessary, and open the User Manager |
| 184 // from the guest profile. | 184 // from the guest profile. |
| 185 profiles::CreateGuestProfileForUserManager( | 185 profiles::CreateGuestProfileForUserManager( |
| 186 profile_path_to_focus, | 186 profile_path_to_focus, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 211 const std::string& url) { | 211 const std::string& url) { |
| 212 DCHECK(!instance_); | 212 DCHECK(!instance_); |
| 213 instance_ = new UserManagerMac(guest_profile); | 213 instance_ = new UserManagerMac(guest_profile); |
| 214 [instance_->window_controller() showURL:GURL(url)]; | 214 [instance_->window_controller() showURL:GURL(url)]; |
| 215 } | 215 } |
| 216 | 216 |
| 217 void UserManagerMac::WindowWasClosed() { | 217 void UserManagerMac::WindowWasClosed() { |
| 218 instance_ = NULL; | 218 instance_ = NULL; |
| 219 delete this; | 219 delete this; |
| 220 } | 220 } |
| OLD | NEW |