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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 1618193003: arc: Pass auth token from Chrome to ARC instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
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/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 ProfileHelper::Get()->GetUserByProfile(profile); 1136 ProfileHelper::Get()->GetUserByProfile(profile);
1137 if (user_manager->GetPrimaryUser() == user) { 1137 if (user_manager->GetPrimaryUser() == user) {
1138 InitRlz(profile); 1138 InitRlz(profile);
1139 InitializeCerts(profile); 1139 InitializeCerts(profile);
1140 InitializeCRLSetFetcher(user); 1140 InitializeCRLSetFetcher(user);
1141 InitializeEVCertificatesWhitelistComponent(user); 1141 InitializeEVCertificatesWhitelistComponent(user);
1142 1142
1143 if (arc::ArcBridgeService::GetEnabled( 1143 if (arc::ArcBridgeService::GetEnabled(
1144 base::CommandLine::ForCurrentProcess())) { 1144 base::CommandLine::ForCurrentProcess())) {
1145 DCHECK(arc::ArcServiceManager::Get()); 1145 DCHECK(arc::ArcServiceManager::Get());
1146 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( 1146 arc::ArcServiceManager::Get()->SetProfileAndAccountId(
1147 multi_user_util::GetAccountIdFromProfile(profile)); 1147 profile, multi_user_util::GetAccountIdFromProfile(profile));
1148 } 1148 }
1149 } 1149 }
1150 1150
1151 UpdateEasyUnlockKeys(user_context_); 1151 UpdateEasyUnlockKeys(user_context_);
1152 user_context_.ClearSecrets(); 1152 user_context_.ClearSecrets();
1153 if (TokenHandlesEnabled()) { 1153 if (TokenHandlesEnabled()) {
1154 CreateTokenUtilIfMissing(); 1154 CreateTokenUtilIfMissing();
1155 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) { 1155 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) {
1156 if (!token_handle_fetcher_.get()) { 1156 if (!token_handle_fetcher_.get()) {
1157 token_handle_fetcher_.reset(new TokenHandleFetcher( 1157 token_handle_fetcher_.reset(new TokenHandleFetcher(
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 bool show_names_on_signin = true; 1778 bool show_names_on_signin = true;
1779 auto cros_settings = CrosSettings::Get(); 1779 auto cros_settings = CrosSettings::Get();
1780 cros_settings->GetBoolean(kAccountsPrefEphemeralUsersEnabled, 1780 cros_settings->GetBoolean(kAccountsPrefEphemeralUsersEnabled,
1781 &ephemeral_users_enabled); 1781 &ephemeral_users_enabled);
1782 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, 1782 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn,
1783 &show_names_on_signin); 1783 &show_names_on_signin);
1784 return show_names_on_signin && !ephemeral_users_enabled; 1784 return show_names_on_signin && !ephemeral_users_enabled;
1785 } 1785 }
1786 1786
1787 void UserSessionManager::Shutdown() { 1787 void UserSessionManager::Shutdown() {
1788 if (arc::ArcBridgeService::GetEnabled(
1789 base::CommandLine::ForCurrentProcess())) {
1790 DCHECK(arc::ArcServiceManager::Get());
1791 arc::ArcServiceManager::Get()->SetProfileAndAccountId(nullptr,
1792 EmptyAccountId());
1793 }
1788 token_handle_fetcher_.reset(); 1794 token_handle_fetcher_.reset();
1789 token_handle_util_.reset(); 1795 token_handle_util_.reset();
1790 first_run::GoodiesDisplayer::Delete(); 1796 first_run::GoodiesDisplayer::Delete();
1791 } 1797 }
1792 1798
1793 void UserSessionManager::CreateTokenUtilIfMissing() { 1799 void UserSessionManager::CreateTokenUtilIfMissing() {
1794 if (!token_handle_util_.get()) 1800 if (!token_handle_util_.get())
1795 token_handle_util_.reset(new TokenHandleUtil()); 1801 token_handle_util_.reset(new TokenHandleUtil());
1796 } 1802 }
1797 1803
1798 } // namespace chromeos 1804 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698