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

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

Issue 2531543003: Resolve initialize/destory order between ArcService and ArcSessionManager. (Closed)
Patch Set: Created 4 years 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/chrome_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/sys_info.h" 11 #include "base/sys_info.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/browser_process_platform_part_chromeos.h" 13 #include "chrome/browser/browser_process_platform_part_chromeos.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" 15 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h"
16 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" 16 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
17 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 17 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
18 #include "chrome/browser/chromeos/arc/arc_session_manager.h" 18 #include "chrome/browser/chromeos/arc/arc_service_launcher.h"
19 #include "chrome/browser/chromeos/boot_times_recorder.h" 19 #include "chrome/browser/chromeos/boot_times_recorder.h"
20 #include "chrome/browser/chromeos/login/login_wizard.h" 20 #include "chrome/browser/chromeos/login/login_wizard.h"
21 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 21 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
22 #include "chrome/browser/chromeos/login/wizard_controller.h" 22 #include "chrome/browser/chromeos/login/wizard_controller.h"
23 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 23 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/signin/signin_manager_factory.h" 25 #include "chrome/browser/signin/signin_manager_factory.h"
26 #include "chrome/browser/ui/ash/ash_util.h" 26 #include "chrome/browser/ui/ash/ash_util.h"
27 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
28 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
29 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
30 #include "chromeos/audio/cras_audio_handler.h" 29 #include "chromeos/audio/cras_audio_handler.h"
31 #include "chromeos/chromeos_switches.h" 30 #include "chromeos/chromeos_switches.h"
32 #include "chromeos/cryptohome/cryptohome_parameters.h" 31 #include "chromeos/cryptohome/cryptohome_parameters.h"
33 #include "chromeos/dbus/dbus_thread_manager.h" 32 #include "chromeos/dbus/dbus_thread_manager.h"
34 #include "chromeos/dbus/session_manager_client.h" 33 #include "chromeos/dbus/session_manager_client.h"
35 #include "components/arc/arc_bridge_service.h" 34 #include "components/arc/arc_bridge_service.h"
36 #include "components/arc/arc_service_manager.h"
37 #include "components/prefs/pref_service.h" 35 #include "components/prefs/pref_service.h"
38 #include "components/signin/core/account_id/account_id.h" 36 #include "components/signin/core/account_id/account_id.h"
39 #include "components/signin/core/browser/signin_manager.h" 37 #include "components/signin/core/browser/signin_manager.h"
40 #include "components/user_manager/user_manager.h" 38 #include "components/user_manager/user_manager.h"
41 #include "components/user_manager/user_names.h" 39 #include "components/user_manager/user_names.h"
42 #include "content/public/browser/notification_service.h" 40 #include "content/public/browser/notification_service.h"
43 #include "content/public/common/content_switches.h" 41 #include "content/public/common/content_switches.h"
44 42
45 namespace chromeos { 43 namespace chromeos {
46 44
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 LOG(ERROR) << "Could not get active user after crash."; 102 LOG(ERROR) << "Could not get active user after crash.";
105 return; 103 return;
106 } 104 }
107 user_session_mgr->InitRlz(user_profile); 105 user_session_mgr->InitRlz(user_profile);
108 user_session_mgr->InitializeCerts(user_profile); 106 user_session_mgr->InitializeCerts(user_profile);
109 user_session_mgr->InitializeCRLSetFetcher(user); 107 user_session_mgr->InitializeCRLSetFetcher(user);
110 user_session_mgr->InitializeCertificateTransparencyComponents(user); 108 user_session_mgr->InitializeCertificateTransparencyComponents(user);
111 109
112 if (arc::ArcBridgeService::GetEnabled( 110 if (arc::ArcBridgeService::GetEnabled(
113 base::CommandLine::ForCurrentProcess())) { 111 base::CommandLine::ForCurrentProcess())) {
114 DCHECK(arc::ArcServiceManager::Get()); 112 arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(
115 std::unique_ptr<BooleanPrefMember> arc_enabled_pref = 113 user_profile);
116 base::MakeUnique<BooleanPrefMember>();
117 arc_enabled_pref->Init(prefs::kArcEnabled, user_profile->GetPrefs());
118 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared(
119 multi_user_util::GetAccountIdFromProfile(user_profile),
120 std::move(arc_enabled_pref));
121 DCHECK(arc::ArcSessionManager::Get());
122 arc::ArcSessionManager::Get()->OnPrimaryUserProfilePrepared(user_profile);
123 } 114 }
124 115
125 // Send the PROFILE_PREPARED notification and call SessionStarted() 116 // Send the PROFILE_PREPARED notification and call SessionStarted()
126 // so that the Launcher and other Profile dependent classes are created. 117 // so that the Launcher and other Profile dependent classes are created.
127 content::NotificationService::current()->Notify( 118 content::NotificationService::current()->Notify(
128 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 119 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
129 content::NotificationService::AllSources(), 120 content::NotificationService::AllSources(),
130 content::Details<Profile>(user_profile)); 121 content::Details<Profile>(user_profile));
131 122
132 // This call will set session state to SESSION_STATE_ACTIVE (same one). 123 // This call will set session state to SESSION_STATE_ACTIVE (same one).
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 const std::string& user_id_hash, 238 const std::string& user_id_hash,
248 bool browser_restart) { 239 bool browser_restart) {
249 BootTimesRecorder* btl = BootTimesRecorder::Get(); 240 BootTimesRecorder* btl = BootTimesRecorder::Get();
250 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); 241 btl->AddLoginTimeMarker("UserLoggedIn-Start", false);
251 session_manager::SessionManager::NotifyUserLoggedIn( 242 session_manager::SessionManager::NotifyUserLoggedIn(
252 user_account_id, user_id_hash, browser_restart); 243 user_account_id, user_id_hash, browser_restart);
253 btl->AddLoginTimeMarker("UserLoggedIn-End", false); 244 btl->AddLoginTimeMarker("UserLoggedIn-End", false);
254 } 245 }
255 246
256 } // namespace chromeos 247 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698