Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1421)

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 // TODO(nkostylev): Deprecate this notification in favor of 1562 // TODO(nkostylev): Deprecate this notification in favor of
1563 // ActiveUserChanged() observer call. 1563 // ActiveUserChanged() observer call.
1564 content::NotificationService::current()->Notify( 1564 content::NotificationService::current()->Notify(
1565 chrome::NOTIFICATION_LOGIN_USER_CHANGED, 1565 chrome::NOTIFICATION_LOGIN_USER_CHANGED,
1566 content::Source<UserManager>(this), 1566 content::Source<UserManager>(this),
1567 content::Details<const User>(active_user_)); 1567 content::Details<const User>(active_user_));
1568 1568
1569 // Owner must be first user in session. DeviceSettingsService can't deal with 1569 // Owner must be first user in session. DeviceSettingsService can't deal with
1570 // multiple user and will mix up ownership, crbug.com/230018. 1570 // multiple user and will mix up ownership, crbug.com/230018.
1571 if (GetLoggedInUsers().size() == 1) { 1571 if (GetLoggedInUsers().size() == 1) {
1572 // Indicate to DeviceSettingsService that the owner key may have become 1572 // Try to load owner key for the active user.
1573 // available. 1573 owner_key_reloader_.ReloadOwnerKey(active_user_->email());
1574 DeviceSettingsService::Get()->SetUsername(active_user_->email());
1575 1574
1576 if (NetworkPortalDetector::IsInitialized()) { 1575 if (NetworkPortalDetector::IsInitialized()) {
1577 NetworkPortalDetector::Get()->SetStrategy( 1576 NetworkPortalDetector::Get()->SetStrategy(
1578 PortalDetectorStrategy::STRATEGY_ID_SESSION); 1577 PortalDetectorStrategy::STRATEGY_ID_SESSION);
1579 } 1578 }
1580 } 1579 }
1581 } 1580 }
1582 1581
1583 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( 1582 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus(
1584 const std::string& user_id) const { 1583 const std::string& user_id) const {
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 } 2102 }
2104 2103
2105 void UserManagerImpl::DeleteUser(User* user) { 2104 void UserManagerImpl::DeleteUser(User* user) {
2106 const bool is_active_user = (user == active_user_); 2105 const bool is_active_user = (user == active_user_);
2107 delete user; 2106 delete user;
2108 if (is_active_user) 2107 if (is_active_user)
2109 active_user_ = NULL; 2108 active_user_ = NULL;
2110 } 2109 }
2111 2110
2112 } // namespace chromeos 2111 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698