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/chromeos/login/users/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
52 #include "chrome/common/crash_keys.h" | 52 #include "chrome/common/crash_keys.h" |
53 #include "chrome/common/pref_names.h" | 53 #include "chrome/common/pref_names.h" |
54 #include "chromeos/chromeos_switches.h" | 54 #include "chromeos/chromeos_switches.h" |
55 #include "chromeos/cryptohome/async_method_caller.h" | 55 #include "chromeos/cryptohome/async_method_caller.h" |
56 #include "chromeos/dbus/dbus_thread_manager.h" | 56 #include "chromeos/dbus/dbus_thread_manager.h" |
57 #include "chromeos/login/auth/user_context.h" | 57 #include "chromeos/login/auth/user_context.h" |
58 #include "chromeos/login/login_state.h" | 58 #include "chromeos/login/login_state.h" |
59 #include "chromeos/login/user_names.h" | 59 #include "chromeos/login/user_names.h" |
60 #include "chromeos/settings/cros_settings_names.h" | 60 #include "chromeos/settings/cros_settings_names.h" |
| 61 #include "components/session_manager/core/session_manager.h" |
61 #include "components/user_manager/user_type.h" | 62 #include "components/user_manager/user_type.h" |
62 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
63 #include "content/public/browser/notification_service.h" | 64 #include "content/public/browser/notification_service.h" |
64 #include "google_apis/gaia/gaia_auth_util.h" | 65 #include "google_apis/gaia/gaia_auth_util.h" |
65 #include "google_apis/gaia/google_service_auth_error.h" | 66 #include "google_apis/gaia/google_service_auth_error.h" |
66 #include "policy/policy_constants.h" | 67 #include "policy/policy_constants.h" |
67 #include "ui/base/l10n/l10n_util.h" | 68 #include "ui/base/l10n/l10n_util.h" |
68 #include "ui/wm/core/wm_core_switches.h" | 69 #include "ui/wm/core/wm_core_switches.h" |
69 | 70 |
70 using content::BrowserThread; | 71 using content::BrowserThread; |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // Move the user to the front. | 487 // Move the user to the front. |
487 SetLRUUser(active_user_); | 488 SetLRUUser(active_user_); |
488 | 489 |
489 NotifyActiveUserHashChanged(active_user_->username_hash()); | 490 NotifyActiveUserHashChanged(active_user_->username_hash()); |
490 NotifyActiveUserChanged(active_user_); | 491 NotifyActiveUserChanged(active_user_); |
491 } | 492 } |
492 | 493 |
493 void UserManagerImpl::SessionStarted() { | 494 void UserManagerImpl::SessionStarted() { |
494 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 495 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
495 session_started_ = true; | 496 session_started_ = true; |
| 497 |
496 UpdateLoginState(); | 498 UpdateLoginState(); |
| 499 g_browser_process->platform_part()->SessionManager()->SetSessionState( |
| 500 session_manager::SESSION_STATE_ACTIVE); |
| 501 |
497 content::NotificationService::current()->Notify( | 502 content::NotificationService::current()->Notify( |
498 chrome::NOTIFICATION_SESSION_STARTED, | 503 chrome::NOTIFICATION_SESSION_STARTED, |
499 content::Source<UserManager>(this), | 504 content::Source<UserManager>(this), |
500 content::Details<const User>(active_user_)); | 505 content::Details<const User>(active_user_)); |
501 if (is_current_user_new_) { | 506 if (is_current_user_new_) { |
502 // Make sure that the new user's data is persisted to Local State. | 507 // Make sure that the new user's data is persisted to Local State. |
503 g_browser_process->local_state()->CommitPendingWrite(); | 508 g_browser_process->local_state()->CommitPendingWrite(); |
504 } | 509 } |
505 } | 510 } |
506 | 511 |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 } | 1773 } |
1769 | 1774 |
1770 void UserManagerImpl::DeleteUser(User* user) { | 1775 void UserManagerImpl::DeleteUser(User* user) { |
1771 const bool is_active_user = (user == active_user_); | 1776 const bool is_active_user = (user == active_user_); |
1772 delete user; | 1777 delete user; |
1773 if (is_active_user) | 1778 if (is_active_user) |
1774 active_user_ = NULL; | 1779 active_user_ = NULL; |
1775 } | 1780 } |
1776 | 1781 |
1777 } // namespace chromeos | 1782 } // namespace chromeos |
OLD | NEW |