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 25 matching lines...) Expand all Loading... |
36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" | 36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" |
37 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" | 37 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" |
38 #include "chrome/browser/chromeos/login/ui/login_display.h" | 38 #include "chrome/browser/chromeos/login/ui/login_display.h" |
39 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" | 39 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
40 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 40 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
41 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" | 41 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" |
42 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 42 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
43 #include "chrome/browser/chromeos/login/wizard_controller.h" | 43 #include "chrome/browser/chromeos/login/wizard_controller.h" |
44 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 44 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
45 #include "chrome/browser/chromeos/net/network_portal_detector_strategy.h" | 45 #include "chrome/browser/chromeos/net/network_portal_detector_strategy.h" |
| 46 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" |
46 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 47 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
47 #include "chrome/browser/chromeos/policy/device_local_account.h" | 48 #include "chrome/browser/chromeos/policy/device_local_account.h" |
48 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" | 49 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
49 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 50 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
50 #include "chrome/browser/chromeos/session_length_limiter.h" | 51 #include "chrome/browser/chromeos/session_length_limiter.h" |
51 #include "chrome/browser/managed_mode/chromeos/managed_user_password_service_fac
tory.h" | 52 #include "chrome/browser/managed_mode/chromeos/managed_user_password_service_fac
tory.h" |
52 #include "chrome/browser/managed_mode/chromeos/manager_password_service_factory.
h" | 53 #include "chrome/browser/managed_mode/chromeos/manager_password_service_factory.
h" |
53 #include "chrome/browser/net/nss_context.h" | 54 #include "chrome/browser/net/nss_context.h" |
54 #include "chrome/browser/profiles/profile.h" | 55 #include "chrome/browser/profiles/profile.h" |
55 #include "chrome/browser/profiles/profile_manager.h" | 56 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 // TODO(nkostylev): Deprecate this notification in favor of | 1560 // TODO(nkostylev): Deprecate this notification in favor of |
1560 // ActiveUserChanged() observer call. | 1561 // ActiveUserChanged() observer call. |
1561 content::NotificationService::current()->Notify( | 1562 content::NotificationService::current()->Notify( |
1562 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 1563 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
1563 content::Source<UserManager>(this), | 1564 content::Source<UserManager>(this), |
1564 content::Details<const User>(active_user_)); | 1565 content::Details<const User>(active_user_)); |
1565 | 1566 |
1566 // Owner must be first user in session. DeviceSettingsService can't deal with | 1567 // Owner must be first user in session. DeviceSettingsService can't deal with |
1567 // multiple user and will mix up ownership, crbug.com/230018. | 1568 // multiple user and will mix up ownership, crbug.com/230018. |
1568 if (GetLoggedInUsers().size() == 1) { | 1569 if (GetLoggedInUsers().size() == 1) { |
1569 // Indicate to DeviceSettingsService that the owner key may have become | 1570 OwnerSettingsServiceFactory::GetInstance()->SetUsername( |
1570 // available. | 1571 active_user_->email()); |
1571 DeviceSettingsService::Get()->SetUsername(active_user_->email()); | |
1572 | |
1573 if (NetworkPortalDetector::IsInitialized()) { | 1572 if (NetworkPortalDetector::IsInitialized()) { |
1574 NetworkPortalDetector::Get()->SetStrategy( | 1573 NetworkPortalDetector::Get()->SetStrategy( |
1575 PortalDetectorStrategy::STRATEGY_ID_SESSION); | 1574 PortalDetectorStrategy::STRATEGY_ID_SESSION); |
1576 } | 1575 } |
1577 } | 1576 } |
1578 } | 1577 } |
1579 | 1578 |
1580 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( | 1579 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( |
1581 const std::string& user_id) const { | 1580 const std::string& user_id) const { |
1582 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1581 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 } | 2086 } |
2088 | 2087 |
2089 void UserManagerImpl::DeleteUser(User* user) { | 2088 void UserManagerImpl::DeleteUser(User* user) { |
2090 const bool is_active_user = (user == active_user_); | 2089 const bool is_active_user = (user == active_user_); |
2091 delete user; | 2090 delete user; |
2092 if (is_active_user) | 2091 if (is_active_user) |
2093 active_user_ = NULL; | 2092 active_user_ = NULL; |
2094 } | 2093 } |
2095 | 2094 |
2096 } // namespace chromeos | 2095 } // namespace chromeos |
OLD | NEW |