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/views/profiles/user_manager_view.h" | 5 #include "chrome/browser/ui/views/profiles/user_manager_view.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/lifetime/application_lifetime.h" | 8 #include "chrome/browser/lifetime/application_lifetime.h" |
9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 UserManagerView* instance_ = NULL; | 41 UserManagerView* instance_ = NULL; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 // UserManager ----------------------------------------------------------------- | 45 // UserManager ----------------------------------------------------------------- |
46 | 46 |
47 void UserManager::Show( | 47 void UserManager::Show( |
48 const base::FilePath& profile_path_to_focus, | 48 const base::FilePath& profile_path_to_focus, |
49 profiles::UserManagerTutorialMode tutorial_mode, | 49 profiles::UserManagerTutorialMode tutorial_mode, |
50 profiles::UserManagerProfileSelected profile_open_action) { | 50 profiles::UserManagerProfileSelected profile_open_action) { |
| 51 DCHECK(profile_path_to_focus != ProfileManager::GetGuestProfilePath()); |
| 52 |
51 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); | 53 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER); |
52 if (instance_) { | 54 if (instance_) { |
53 // If we are showing the User Manager after locking a profile, change the | 55 // If we are showing the User Manager after locking a profile, change the |
54 // active profile to Guest. | 56 // active profile to Guest. |
55 profiles::SetActiveProfileToGuestIfLocked(); | 57 profiles::SetActiveProfileToGuestIfLocked(); |
56 | 58 |
57 // If there's a user manager window open already, just activate it. | 59 // If there's a user manager window open already, just activate it. |
58 instance_->GetWidget()->Activate(); | 60 instance_->GetWidget()->Activate(); |
59 return; | 61 return; |
60 } | 62 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Now that the window is closed, we can allow a new one to be opened. | 201 // Now that the window is closed, we can allow a new one to be opened. |
200 // (WindowClosing comes in asynchronously from the call to Close() and we | 202 // (WindowClosing comes in asynchronously from the call to Close() and we |
201 // may have already opened a new instance). | 203 // may have already opened a new instance). |
202 if (instance_ == this) | 204 if (instance_ == this) |
203 instance_ = NULL; | 205 instance_ = NULL; |
204 } | 206 } |
205 | 207 |
206 bool UserManagerView::UseNewStyleForThisDialog() const { | 208 bool UserManagerView::UseNewStyleForThisDialog() const { |
207 return false; | 209 return false; |
208 } | 210 } |
OLD | NEW |