OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 // TODO(nkostylev): Deprecate this notification in favor of | 1556 // TODO(nkostylev): Deprecate this notification in favor of |
1557 // ActiveUserChanged() observer call. | 1557 // ActiveUserChanged() observer call. |
1558 content::NotificationService::current()->Notify( | 1558 content::NotificationService::current()->Notify( |
1559 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 1559 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
1560 content::Source<UserManager>(this), | 1560 content::Source<UserManager>(this), |
1561 content::Details<const User>(active_user_)); | 1561 content::Details<const User>(active_user_)); |
1562 | 1562 |
1563 // Owner must be first user in session. DeviceSettingsService can't deal with | 1563 // Owner must be first user in session. DeviceSettingsService can't deal with |
1564 // multiple user and will mix up ownership, crbug.com/230018. | 1564 // multiple user and will mix up ownership, crbug.com/230018. |
1565 if (GetLoggedInUsers().size() == 1) { | 1565 if (GetLoggedInUsers().size() == 1) { |
1566 // Indicate to DeviceSettingsService that the owner key may have become | |
1567 // available. | |
1568 DeviceSettingsService::Get()->SetUsername(active_user_->email()); | |
1569 | |
1570 if (NetworkPortalDetector::IsInitialized()) { | 1566 if (NetworkPortalDetector::IsInitialized()) { |
1571 NetworkPortalDetector::Get()->SetStrategy( | 1567 NetworkPortalDetector::Get()->SetStrategy( |
1572 PortalDetectorStrategy::STRATEGY_ID_SESSION); | 1568 PortalDetectorStrategy::STRATEGY_ID_SESSION); |
1573 } | 1569 } |
1574 } | 1570 } |
1575 } | 1571 } |
1576 | 1572 |
1577 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( | 1573 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( |
1578 const std::string& user_id) const { | 1574 const std::string& user_id) const { |
1579 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1575 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 } | 2093 } |
2098 | 2094 |
2099 void UserManagerImpl::DeleteUser(User* user) { | 2095 void UserManagerImpl::DeleteUser(User* user) { |
2100 const bool is_active_user = (user == active_user_); | 2096 const bool is_active_user = (user == active_user_); |
2101 delete user; | 2097 delete user; |
2102 if (is_active_user) | 2098 if (is_active_user) |
2103 active_user_ = NULL; | 2099 active_user_ = NULL; |
2104 } | 2100 } |
2105 | 2101 |
2106 } // namespace chromeos | 2102 } // namespace chromeos |
OLD | NEW |