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