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

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 18 matching lines...) Expand all
29 #include "chrome/browser/app_mode/app_mode_utils.h" 29 #include "chrome/browser/app_mode/app_mode_utils.h"
30 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
31 #include "chrome/browser/chrome_notification_types.h" 31 #include "chrome/browser/chrome_notification_types.h"
32 #include "chrome/browser/chromeos/base/locale_util.h" 32 #include "chrome/browser/chromeos/base/locale_util.h"
33 #include "chrome/browser/chromeos/login/auth_sync_observer.h" 33 #include "chrome/browser/chromeos/login/auth_sync_observer.h"
34 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h" 34 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h"
35 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" 35 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
36 #include "chrome/browser/chromeos/login/login_display.h" 36 #include "chrome/browser/chromeos/login/login_display.h"
37 #include "chrome/browser/chromeos/login/login_utils.h" 37 #include "chrome/browser/chromeos/login/login_utils.h"
38 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" 38 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h"
39 #include "chrome/browser/chromeos/login/owner_settings_service_factory.h"
39 #include "chrome/browser/chromeos/login/remove_user_delegate.h" 40 #include "chrome/browser/chromeos/login/remove_user_delegate.h"
40 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h" 41 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h"
41 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" 42 #include "chrome/browser/chromeos/login/user_image_manager_impl.h"
42 #include "chrome/browser/chromeos/login/wizard_controller.h" 43 #include "chrome/browser/chromeos/login/wizard_controller.h"
43 #include "chrome/browser/chromeos/net/network_portal_detector.h" 44 #include "chrome/browser/chromeos/net/network_portal_detector.h"
44 #include "chrome/browser/chromeos/net/network_portal_detector_strategy.h" 45 #include "chrome/browser/chromeos/net/network_portal_detector_strategy.h"
45 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 46 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
46 #include "chrome/browser/chromeos/policy/device_local_account.h" 47 #include "chrome/browser/chromeos/policy/device_local_account.h"
47 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog. h" 48 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog. h"
48 #include "chrome/browser/chromeos/profiles/profile_helper.h" 49 #include "chrome/browser/chromeos/profiles/profile_helper.h"
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 UpdateLoginState(); 1556 UpdateLoginState();
1556 // TODO(nkostylev): Deprecate this notification in favor of 1557 // TODO(nkostylev): Deprecate this notification in favor of
1557 // ActiveUserChanged() observer call. 1558 // ActiveUserChanged() observer call.
1558 content::NotificationService::current()->Notify( 1559 content::NotificationService::current()->Notify(
1559 chrome::NOTIFICATION_LOGIN_USER_CHANGED, 1560 chrome::NOTIFICATION_LOGIN_USER_CHANGED,
1560 content::Source<UserManager>(this), 1561 content::Source<UserManager>(this),
1561 content::Details<const User>(active_user_)); 1562 content::Details<const User>(active_user_));
1562 1563
1563 // Owner must be first user in session. DeviceSettingsService can't deal with 1564 // Owner must be first user in session. DeviceSettingsService can't deal with
1564 // multiple user and will mix up ownership, crbug.com/230018. 1565 // multiple user and will mix up ownership, crbug.com/230018.
1565 if (GetLoggedInUsers().size() == 1) { 1566 if (GetLoggedInUsers().size() == 1) {
Nikita (slow) 2014/05/15 12:48:58 When do you plan to remove this restriction? Can i
ygorshenin1 2014/05/16 12:09:37 No, owner still can't be added as a secondary user
1566 // Indicate to DeviceSettingsService that the owner key may have become 1567 OwnerSettingsServiceFactory::GetInstance()->SetUsername(
1567 // available. 1568 active_user_->email());
1568 DeviceSettingsService::Get()->SetUsername(active_user_->email());
1569
1570 if (NetworkPortalDetector::IsInitialized()) { 1569 if (NetworkPortalDetector::IsInitialized()) {
1571 NetworkPortalDetector::Get()->SetStrategy( 1570 NetworkPortalDetector::Get()->SetStrategy(
1572 PortalDetectorStrategy::STRATEGY_ID_SESSION); 1571 PortalDetectorStrategy::STRATEGY_ID_SESSION);
1573 } 1572 }
1574 } 1573 }
1575 } 1574 }
1576 1575
1577 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( 1576 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus(
1578 const std::string& user_id) const { 1577 const std::string& user_id) const {
1579 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1578 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 } 2096 }
2098 2097
2099 void UserManagerImpl::DeleteUser(User* user) { 2098 void UserManagerImpl::DeleteUser(User* user) {
2100 const bool is_active_user = (user == active_user_); 2099 const bool is_active_user = (user == active_user_);
2101 delete user; 2100 delete user;
2102 if (is_active_user) 2101 if (is_active_user)
2103 active_user_ = NULL; 2102 active_user_ = NULL;
2104 } 2103 }
2105 2104
2106 } // namespace chromeos 2105 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698