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

Side by Side Diff: chrome/browser/browser_process_platform_part_chromeos.cc

Issue 2444383008: session_manager: Create ChromeSessionManager early (Closed)
Patch Set: for #4 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 (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/browser_process_platform_part_chromeos.h" 5 #include "chrome/browser/browser_process_platform_part_chromeos.h"
6 6
7 #include "base/command_line.h"
8 #include "base/logging.h" 7 #include "base/logging.h"
9 #include "base/time/default_tick_clock.h" 8 #include "base/time/default_tick_clock.h"
10 #include "base/time/tick_clock.h" 9 #include "base/time/tick_clock.h"
11 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" 11 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" 12 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
14 #include "chrome/browser/chromeos/net/delay_network_call.h" 13 #include "chrome/browser/chromeos/net/delay_network_call.h"
15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 14 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" 15 #include "chrome/browser/chromeos/profiles/profile_helper.h"
17 #include "chrome/browser/chromeos/settings/cros_settings.h" 16 #include "chrome/browser/chromeos/settings/cros_settings.h"
18 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" 17 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
19 #include "chrome/browser/chromeos/system/device_disabling_manager.h" 18 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
20 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega te.h" 19 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega te.h"
21 #include "chrome/browser/chromeos/system/system_clock.h" 20 #include "chrome/browser/chromeos/system/system_clock.h"
22 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" 21 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h"
23 #include "chrome/browser/chromeos/system/timezone_util.h" 22 #include "chrome/browser/chromeos/system/timezone_util.h"
24 #include "chrome/browser/lifetime/keep_alive_types.h" 23 #include "chrome/browser/lifetime/keep_alive_types.h"
25 #include "chrome/browser/lifetime/scoped_keep_alive.h" 24 #include "chrome/browser/lifetime/scoped_keep_alive.h"
26 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
28 #include "chromeos/geolocation/simple_geolocation_provider.h" 26 #include "chromeos/geolocation/simple_geolocation_provider.h"
29 #include "chromeos/timezone/timezone_resolver.h" 27 #include "chromeos/timezone/timezone_resolver.h"
30 #include "components/session_manager/core/session_manager.h" 28 #include "components/session_manager/core/session_manager.h"
31 #include "components/user_manager/user_manager.h" 29 #include "components/user_manager/user_manager.h"
32 30
33 BrowserProcessPlatformPart::BrowserProcessPlatformPart() 31 BrowserProcessPlatformPart::BrowserProcessPlatformPart()
34 : created_profile_helper_(false) {} 32 : created_profile_helper_(false) {}
35 33
36 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {} 34 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {}
(...skipping 30 matching lines...) Expand all
67 device_disabling_manager_delegate_.get(), 65 device_disabling_manager_delegate_.get(),
68 chromeos::CrosSettings::Get(), 66 chromeos::CrosSettings::Get(),
69 user_manager::UserManager::Get())); 67 user_manager::UserManager::Get()));
70 } 68 }
71 69
72 void BrowserProcessPlatformPart::ShutdownDeviceDisablingManager() { 70 void BrowserProcessPlatformPart::ShutdownDeviceDisablingManager() {
73 device_disabling_manager_.reset(); 71 device_disabling_manager_.reset();
74 device_disabling_manager_delegate_.reset(); 72 device_disabling_manager_delegate_.reset();
75 } 73 }
76 74
77 void BrowserProcessPlatformPart::InitializeSessionManager( 75 void BrowserProcessPlatformPart::InitializeSessionManager() {
78 const base::CommandLine& parsed_command_line,
79 Profile* profile,
80 bool is_running_test) {
81 DCHECK(!session_manager_); 76 DCHECK(!session_manager_);
82 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager( 77 session_manager_ = base::MakeUnique<chromeos::ChromeSessionManager>();
83 parsed_command_line, profile, is_running_test);
84 } 78 }
85 79
86 void BrowserProcessPlatformPart::ShutdownSessionManager() { 80 void BrowserProcessPlatformPart::ShutdownSessionManager() {
87 session_manager_.reset(); 81 session_manager_.reset();
88 } 82 }
89 83
90 session_manager::SessionManager* BrowserProcessPlatformPart::SessionManager() {
91 DCHECK(CalledOnValidThread());
92 return session_manager_.get();
93 }
94
95 void BrowserProcessPlatformPart::RegisterKeepAlive() { 84 void BrowserProcessPlatformPart::RegisterKeepAlive() {
96 DCHECK(!keep_alive_); 85 DCHECK(!keep_alive_);
97 keep_alive_.reset( 86 keep_alive_.reset(
98 new ScopedKeepAlive(KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS, 87 new ScopedKeepAlive(KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS,
99 KeepAliveRestartOption::DISABLED)); 88 KeepAliveRestartOption::DISABLED));
100 } 89 }
101 90
102 void BrowserProcessPlatformPart::UnregisterKeepAlive() { 91 void BrowserProcessPlatformPart::UnregisterKeepAlive() {
103 keep_alive_.reset(); 92 keep_alive_.reset();
104 } 93 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 150
162 void BrowserProcessPlatformPart::DestroySystemClock() { 151 void BrowserProcessPlatformPart::DestroySystemClock() {
163 system_clock_.reset(); 152 system_clock_.reset();
164 } 153 }
165 154
166 void BrowserProcessPlatformPart::CreateProfileHelper() { 155 void BrowserProcessPlatformPart::CreateProfileHelper() {
167 DCHECK(!created_profile_helper_ && !profile_helper_); 156 DCHECK(!created_profile_helper_ && !profile_helper_);
168 created_profile_helper_ = true; 157 created_profile_helper_ = true;
169 profile_helper_.reset(new chromeos::ProfileHelper()); 158 profile_helper_.reset(new chromeos::ProfileHelper());
170 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_platform_part_chromeos.h ('k') | chrome/browser/chromeos/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698