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

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

Issue 2507073002: Split ArcSessionManager from ArcAuthService. (Closed)
Patch Set: Fix rebase mistake Created 4 years, 1 month 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 14 matching lines...) Expand all
25 #include "base/task_runner_util.h" 25 #include "base/task_runner_util.h"
26 #include "base/threading/thread_task_runner_handle.h" 26 #include "base/threading/thread_task_runner_handle.h"
27 #include "base/threading/worker_pool.h" 27 #include "base/threading/worker_pool.h"
28 #include "chrome/browser/about_flags.h" 28 #include "chrome/browser/about_flags.h"
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/browser_process_platform_part_chromeos.h" 31 #include "chrome/browser/browser_process_platform_part_chromeos.h"
32 #include "chrome/browser/browser_shutdown.h" 32 #include "chrome/browser/browser_shutdown.h"
33 #include "chrome/browser/chrome_notification_types.h" 33 #include "chrome/browser/chrome_notification_types.h"
34 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 34 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
35 #include "chrome/browser/chromeos/arc/arc_auth_service.h" 35 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
36 #include "chrome/browser/chromeos/base/locale_util.h" 36 #include "chrome/browser/chromeos/base/locale_util.h"
37 #include "chrome/browser/chromeos/boot_times_recorder.h" 37 #include "chrome/browser/chromeos/boot_times_recorder.h"
38 #include "chrome/browser/chromeos/first_run/first_run.h" 38 #include "chrome/browser/chromeos/first_run/first_run.h"
39 #include "chrome/browser/chromeos/first_run/goodies_displayer.h" 39 #include "chrome/browser/chromeos/first_run/goodies_displayer.h"
40 #include "chrome/browser/chromeos/input_method/input_method_util.h" 40 #include "chrome/browser/chromeos/input_method/input_method_util.h"
41 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" 41 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
42 #include "chrome/browser/chromeos/login/chrome_restart_request.h" 42 #include "chrome/browser/chromeos/login/chrome_restart_request.h"
43 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" 43 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
44 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" 44 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h"
45 #include "chrome/browser/chromeos/login/existing_user_controller.h" 45 #include "chrome/browser/chromeos/login/existing_user_controller.h"
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 if (arc::ArcBridgeService::GetEnabled( 1149 if (arc::ArcBridgeService::GetEnabled(
1150 base::CommandLine::ForCurrentProcess())) { 1150 base::CommandLine::ForCurrentProcess())) {
1151 const AccountId& account_id = 1151 const AccountId& account_id =
1152 multi_user_util::GetAccountIdFromProfile(profile); 1152 multi_user_util::GetAccountIdFromProfile(profile);
1153 std::unique_ptr<BooleanPrefMember> arc_enabled_pref = 1153 std::unique_ptr<BooleanPrefMember> arc_enabled_pref =
1154 base::MakeUnique<BooleanPrefMember>(); 1154 base::MakeUnique<BooleanPrefMember>();
1155 arc_enabled_pref->Init(prefs::kArcEnabled, profile->GetPrefs()); 1155 arc_enabled_pref->Init(prefs::kArcEnabled, profile->GetPrefs());
1156 DCHECK(arc::ArcServiceManager::Get()); 1156 DCHECK(arc::ArcServiceManager::Get());
1157 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( 1157 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared(
1158 account_id, std::move(arc_enabled_pref)); 1158 account_id, std::move(arc_enabled_pref));
1159 arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get(); 1159 arc::ArcSessionManager* arc_session_manager =
1160 DCHECK(arc_auth_service); 1160 arc::ArcSessionManager::Get();
1161 arc_auth_service->OnPrimaryUserProfilePrepared(profile); 1161 DCHECK(arc_session_manager);
1162 arc_session_manager->OnPrimaryUserProfilePrepared(profile);
1162 } 1163 }
1163 } 1164 }
1164 1165
1165 UpdateEasyUnlockKeys(user_context_); 1166 UpdateEasyUnlockKeys(user_context_);
1166 user_context_.ClearSecrets(); 1167 user_context_.ClearSecrets();
1167 if (TokenHandlesEnabled()) { 1168 if (TokenHandlesEnabled()) {
1168 CreateTokenUtilIfMissing(); 1169 CreateTokenUtilIfMissing();
1169 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) { 1170 if (token_handle_util_->ShouldObtainHandle(user->GetAccountId())) {
1170 if (!token_handle_fetcher_.get()) { 1171 if (!token_handle_fetcher_.get()) {
1171 token_handle_fetcher_.reset(new TokenHandleFetcher( 1172 token_handle_fetcher_.reset(new TokenHandleFetcher(
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 &ephemeral_users_enabled); 1838 &ephemeral_users_enabled);
1838 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, 1839 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn,
1839 &show_names_on_signin); 1840 &show_names_on_signin);
1840 return show_names_on_signin && !ephemeral_users_enabled; 1841 return show_names_on_signin && !ephemeral_users_enabled;
1841 } 1842 }
1842 1843
1843 void UserSessionManager::Shutdown() { 1844 void UserSessionManager::Shutdown() {
1844 if (arc::ArcBridgeService::GetEnabled( 1845 if (arc::ArcBridgeService::GetEnabled(
1845 base::CommandLine::ForCurrentProcess())) { 1846 base::CommandLine::ForCurrentProcess())) {
1846 DCHECK(arc::ArcServiceManager::Get()); 1847 DCHECK(arc::ArcServiceManager::Get());
1847 arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get(); 1848 arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
1848 if (arc_auth_service) 1849 if (arc_session_manager)
1849 arc_auth_service->Shutdown(); 1850 arc_session_manager->Shutdown();
1850 } 1851 }
1851 token_handle_fetcher_.reset(); 1852 token_handle_fetcher_.reset();
1852 token_handle_util_.reset(); 1853 token_handle_util_.reset();
1853 first_run::GoodiesDisplayer::Delete(); 1854 first_run::GoodiesDisplayer::Delete();
1854 } 1855 }
1855 1856
1856 void UserSessionManager::CreateTokenUtilIfMissing() { 1857 void UserSessionManager::CreateTokenUtilIfMissing() {
1857 if (!token_handle_util_.get()) 1858 if (!token_handle_util_.get())
1858 token_handle_util_.reset(new TokenHandleUtil()); 1859 token_handle_util_.reset(new TokenHandleUtil());
1859 } 1860 }
(...skipping 10 matching lines...) Expand all
1870 ->browser_policy_connector_chromeos() 1871 ->browser_policy_connector_chromeos()
1871 ->IsEnterpriseManaged()) { 1872 ->IsEnterpriseManaged()) {
1872 return false; 1873 return false;
1873 } 1874 }
1874 1875
1875 // Do not show end of life notification if this is a guest session 1876 // Do not show end of life notification if this is a guest session
1876 return !profile->IsGuestSession(); 1877 return !profile->IsGuestSession();
1877 } 1878 }
1878 1879
1879 } // namespace chromeos 1880 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/session/chrome_session_manager.cc ('k') | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698