OLD | NEW |
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" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
10 #include "base/time/tick_clock.h" | 10 #include "base/time/tick_clock.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" | 12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" | 13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
14 #include "chrome/browser/chromeos/net/delay_network_call.h" | 14 #include "chrome/browser/chromeos/net/delay_network_call.h" |
15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
18 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" | 18 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" |
19 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 19 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
20 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega
te.h" | 20 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega
te.h" |
21 #include "chrome/browser/chromeos/system/system_clock.h" | 21 #include "chrome/browser/chromeos/system/system_clock.h" |
22 #include "chrome/browser/chromeos/system/timezone_util.h" | 22 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 23 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 24 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
23 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
25 #include "chromeos/geolocation/simple_geolocation_provider.h" | 27 #include "chromeos/geolocation/simple_geolocation_provider.h" |
26 #include "chromeos/timezone/timezone_resolver.h" | 28 #include "chromeos/timezone/timezone_resolver.h" |
27 #include "components/session_manager/core/session_manager.h" | 29 #include "components/session_manager/core/session_manager.h" |
28 #include "components/user_manager/user_manager.h" | 30 #include "components/user_manager/user_manager.h" |
29 | 31 |
30 BrowserProcessPlatformPart::BrowserProcessPlatformPart() | 32 BrowserProcessPlatformPart::BrowserProcessPlatformPart() |
31 : created_profile_helper_(false) { | 33 : created_profile_helper_(false) { |
32 } | 34 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 86 |
85 void BrowserProcessPlatformPart::ShutdownSessionManager() { | 87 void BrowserProcessPlatformPart::ShutdownSessionManager() { |
86 session_manager_.reset(); | 88 session_manager_.reset(); |
87 } | 89 } |
88 | 90 |
89 session_manager::SessionManager* BrowserProcessPlatformPart::SessionManager() { | 91 session_manager::SessionManager* BrowserProcessPlatformPart::SessionManager() { |
90 DCHECK(CalledOnValidThread()); | 92 DCHECK(CalledOnValidThread()); |
91 return session_manager_.get(); | 93 return session_manager_.get(); |
92 } | 94 } |
93 | 95 |
| 96 void BrowserProcessPlatformPart::RegisterKeepAlive() { |
| 97 DCHECK(!keep_alive_); |
| 98 keep_alive_.reset( |
| 99 new ScopedKeepAlive(KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS, |
| 100 KeepAliveRestartOption::DISABLED)); |
| 101 } |
| 102 |
| 103 void BrowserProcessPlatformPart::UnregisterKeepAlive() { |
| 104 keep_alive_.reset(); |
| 105 } |
| 106 |
94 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { | 107 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { |
95 DCHECK(CalledOnValidThread()); | 108 DCHECK(CalledOnValidThread()); |
96 if (!created_profile_helper_) | 109 if (!created_profile_helper_) |
97 CreateProfileHelper(); | 110 CreateProfileHelper(); |
98 return profile_helper_.get(); | 111 return profile_helper_.get(); |
99 } | 112 } |
100 | 113 |
101 policy::BrowserPolicyConnectorChromeOS* | 114 policy::BrowserPolicyConnectorChromeOS* |
102 BrowserProcessPlatformPart::browser_policy_connector_chromeos() { | 115 BrowserProcessPlatformPart::browser_policy_connector_chromeos() { |
103 return static_cast<policy::BrowserPolicyConnectorChromeOS*>( | 116 return static_cast<policy::BrowserPolicyConnectorChromeOS*>( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { | 148 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { |
136 return scoped_ptr<policy::BrowserPolicyConnector>( | 149 return scoped_ptr<policy::BrowserPolicyConnector>( |
137 new policy::BrowserPolicyConnectorChromeOS()); | 150 new policy::BrowserPolicyConnectorChromeOS()); |
138 } | 151 } |
139 | 152 |
140 void BrowserProcessPlatformPart::CreateProfileHelper() { | 153 void BrowserProcessPlatformPart::CreateProfileHelper() { |
141 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); | 154 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); |
142 created_profile_helper_ = true; | 155 created_profile_helper_ = true; |
143 profile_helper_.reset(new chromeos::ProfileHelper()); | 156 profile_helper_.reset(new chromeos::ProfileHelper()); |
144 } | 157 } |
OLD | NEW |