| 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 window_controller_.reset([[UserManagerWindowController alloc] | 170 window_controller_.reset([[UserManagerWindowController alloc] |
| 171 initWithProfile:profile withObserver:this]); | 171 initWithProfile:profile withObserver:this]); |
| 172 } | 172 } |
| 173 | 173 |
| 174 UserManagerMac::~UserManagerMac() { | 174 UserManagerMac::~UserManagerMac() { |
| 175 } | 175 } |
| 176 | 176 |
| 177 // static | 177 // static |
| 178 void UserManagerMac::Show(const base::FilePath& profile_path_to_focus, | 178 void UserManagerMac::Show(const base::FilePath& profile_path_to_focus, |
| 179 profiles::UserManagerTutorialMode tutorial_mode) { | 179 profiles::UserManagerTutorialMode tutorial_mode) { |
| 180 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); |
| 180 if (instance_) { | 181 if (instance_) { |
| 181 // If there's a user manager window open already, just activate it. | 182 // If there's a user manager window open already, just activate it. |
| 182 [instance_->window_controller_ show]; | 183 [instance_->window_controller_ show]; |
| 183 return; | 184 return; |
| 184 } | 185 } |
| 185 | 186 |
| 186 // Create the guest profile, if necessary, and open the User Manager | 187 // Create the guest profile, if necessary, and open the User Manager |
| 187 // from the guest profile. | 188 // from the guest profile. |
| 188 profiles::CreateGuestProfileForUserManager( | 189 profiles::CreateGuestProfileForUserManager( |
| 189 profile_path_to_focus, | 190 profile_path_to_focus, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 206 void UserManagerMac::OnGuestProfileCreated(Profile* guest_profile, | 207 void UserManagerMac::OnGuestProfileCreated(Profile* guest_profile, |
| 207 const std::string& url) { | 208 const std::string& url) { |
| 208 instance_ = new UserManagerMac(guest_profile); | 209 instance_ = new UserManagerMac(guest_profile); |
| 209 [instance_->window_controller_ showURL:GURL(url)]; | 210 [instance_->window_controller_ showURL:GURL(url)]; |
| 210 } | 211 } |
| 211 | 212 |
| 212 void UserManagerMac::WindowWasClosed() { | 213 void UserManagerMac::WindowWasClosed() { |
| 213 instance_ = NULL; | 214 instance_ = NULL; |
| 214 delete this; | 215 delete this; |
| 215 } | 216 } |
| OLD | NEW |