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

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: Refactored. Added LSO UI Created 4 years, 10 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 15 matching lines...) Expand all
26 #include "base/task_runner_util.h" 26 #include "base/task_runner_util.h"
27 #include "base/thread_task_runner_handle.h" 27 #include "base/thread_task_runner_handle.h"
28 #include "base/threading/worker_pool.h" 28 #include "base/threading/worker_pool.h"
29 #include "chrome/browser/about_flags.h" 29 #include "chrome/browser/about_flags.h"
30 #include "chrome/browser/app_mode/app_mode_utils.h" 30 #include "chrome/browser/app_mode/app_mode_utils.h"
31 #include "chrome/browser/browser_process.h" 31 #include "chrome/browser/browser_process.h"
32 #include "chrome/browser/browser_process_platform_part_chromeos.h" 32 #include "chrome/browser/browser_process_platform_part_chromeos.h"
33 #include "chrome/browser/browser_shutdown.h" 33 #include "chrome/browser/browser_shutdown.h"
34 #include "chrome/browser/chrome_notification_types.h" 34 #include "chrome/browser/chrome_notification_types.h"
35 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 35 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
36 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
36 #include "chrome/browser/chromeos/base/locale_util.h" 37 #include "chrome/browser/chromeos/base/locale_util.h"
37 #include "chrome/browser/chromeos/boot_times_recorder.h" 38 #include "chrome/browser/chromeos/boot_times_recorder.h"
38 #include "chrome/browser/chromeos/first_run/first_run.h" 39 #include "chrome/browser/chromeos/first_run/first_run.h"
39 #include "chrome/browser/chromeos/first_run/goodies_displayer.h" 40 #include "chrome/browser/chromeos/first_run/goodies_displayer.h"
40 #include "chrome/browser/chromeos/input_method/input_method_util.h" 41 #include "chrome/browser/chromeos/input_method/input_method_util.h"
41 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" 42 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
42 #include "chrome/browser/chromeos/login/chrome_restart_request.h" 43 #include "chrome/browser/chromeos/login/chrome_restart_request.h"
43 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" 44 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
44 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" 45 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h"
45 #include "chrome/browser/chromeos/login/helper.h" 46 #include "chrome/browser/chromeos/login/helper.h"
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 InitRlz(profile); 1139 InitRlz(profile);
1139 InitializeCerts(profile); 1140 InitializeCerts(profile);
1140 InitializeCRLSetFetcher(user); 1141 InitializeCRLSetFetcher(user);
1141 InitializeEVCertificatesWhitelistComponent(user); 1142 InitializeEVCertificatesWhitelistComponent(user);
1142 1143
1143 if (arc::ArcBridgeService::GetEnabled( 1144 if (arc::ArcBridgeService::GetEnabled(
1144 base::CommandLine::ForCurrentProcess())) { 1145 base::CommandLine::ForCurrentProcess())) {
1145 DCHECK(arc::ArcServiceManager::Get()); 1146 DCHECK(arc::ArcServiceManager::Get());
1146 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( 1147 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared(
1147 multi_user_util::GetAccountIdFromProfile(profile)); 1148 multi_user_util::GetAccountIdFromProfile(profile));
1149 arc::ArcAuthService::Get()->SetProfile(profile);
xiyuan 2016/01/26 23:37:05 nit: Prefer to have something similar to ArcServic
khmel 2016/01/27 22:36:21 Sounds better, thanks
1148 } 1150 }
1149 } 1151 }
1150 1152
1151 UpdateEasyUnlockKeys(user_context_); 1153 UpdateEasyUnlockKeys(user_context_);
1152 user_context_.ClearSecrets(); 1154 user_context_.ClearSecrets();
1153 if (TokenHandlesEnabled()) { 1155 if (TokenHandlesEnabled()) {
1154 CreateTokenUtilIfMissing(); 1156 CreateTokenUtilIfMissing();
1155 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) { 1157 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) {
1156 if (!token_handle_fetcher_.get()) { 1158 if (!token_handle_fetcher_.get()) {
1157 token_handle_fetcher_.reset(new TokenHandleFetcher( 1159 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; 1780 bool show_names_on_signin = true;
1779 auto cros_settings = CrosSettings::Get(); 1781 auto cros_settings = CrosSettings::Get();
1780 cros_settings->GetBoolean(kAccountsPrefEphemeralUsersEnabled, 1782 cros_settings->GetBoolean(kAccountsPrefEphemeralUsersEnabled,
1781 &ephemeral_users_enabled); 1783 &ephemeral_users_enabled);
1782 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, 1784 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn,
1783 &show_names_on_signin); 1785 &show_names_on_signin);
1784 return show_names_on_signin && !ephemeral_users_enabled; 1786 return show_names_on_signin && !ephemeral_users_enabled;
1785 } 1787 }
1786 1788
1787 void UserSessionManager::Shutdown() { 1789 void UserSessionManager::Shutdown() {
1790 if (arc::ArcBridgeService::GetEnabled(
1791 base::CommandLine::ForCurrentProcess())) {
1792 DCHECK(arc::ArcServiceManager::Get());
1793 arc::ArcAuthService::Get()->SetProfile(nullptr);
xiyuan 2016/01/26 23:37:05 nit: Similarly, prefer to have something like ArcS
khmel 2016/01/27 22:36:21 Done.
1794 }
1788 token_handle_fetcher_.reset(); 1795 token_handle_fetcher_.reset();
1789 token_handle_util_.reset(); 1796 token_handle_util_.reset();
1790 first_run::GoodiesDisplayer::Delete(); 1797 first_run::GoodiesDisplayer::Delete();
1791 } 1798 }
1792 1799
1793 void UserSessionManager::CreateTokenUtilIfMissing() { 1800 void UserSessionManager::CreateTokenUtilIfMissing() {
1794 if (!token_handle_util_.get()) 1801 if (!token_handle_util_.get())
1795 token_handle_util_.reset(new TokenHandleUtil()); 1802 token_handle_util_.reset(new TokenHandleUtil());
1796 } 1803 }
1797 1804
1798 } // namespace chromeos 1805 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698