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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 25 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
27 #include "chromeos/geolocation/simple_geolocation_provider.h" | 27 #include "chromeos/geolocation/simple_geolocation_provider.h" |
28 #include "chromeos/timezone/timezone_resolver.h" | 28 #include "chromeos/timezone/timezone_resolver.h" |
29 #include "components/session_manager/core/session_manager.h" | 29 #include "components/session_manager/core/session_manager.h" |
30 #include "components/user_manager/user_manager.h" | 30 #include "components/user_manager/user_manager.h" |
31 | 31 |
32 BrowserProcessPlatformPart::BrowserProcessPlatformPart() | 32 BrowserProcessPlatformPart::BrowserProcessPlatformPart() |
33 : created_profile_helper_(false) {} | 33 : created_profile_helper_(false) {} |
34 | 34 |
35 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {} | 35 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { |
| 36 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 37 } |
36 | 38 |
37 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { | 39 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { |
38 DCHECK(!automatic_reboot_manager_); | 40 DCHECK(!automatic_reboot_manager_); |
39 | 41 |
40 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( | 42 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( |
41 std::unique_ptr<base::TickClock>(new base::DefaultTickClock))); | 43 std::unique_ptr<base::TickClock>(new base::DefaultTickClock))); |
42 } | 44 } |
43 | 45 |
44 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { | 46 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { |
45 automatic_reboot_manager_.reset(); | 47 automatic_reboot_manager_.reset(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 keep_alive_.reset( | 90 keep_alive_.reset( |
89 new ScopedKeepAlive(KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS, | 91 new ScopedKeepAlive(KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS, |
90 KeepAliveRestartOption::DISABLED)); | 92 KeepAliveRestartOption::DISABLED)); |
91 } | 93 } |
92 | 94 |
93 void BrowserProcessPlatformPart::UnregisterKeepAlive() { | 95 void BrowserProcessPlatformPart::UnregisterKeepAlive() { |
94 keep_alive_.reset(); | 96 keep_alive_.reset(); |
95 } | 97 } |
96 | 98 |
97 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { | 99 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { |
98 DCHECK(CalledOnValidThread()); | 100 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
99 if (!created_profile_helper_) | 101 if (!created_profile_helper_) |
100 CreateProfileHelper(); | 102 CreateProfileHelper(); |
101 return profile_helper_.get(); | 103 return profile_helper_.get(); |
102 } | 104 } |
103 | 105 |
104 policy::BrowserPolicyConnectorChromeOS* | 106 policy::BrowserPolicyConnectorChromeOS* |
105 BrowserProcessPlatformPart::browser_policy_connector_chromeos() { | 107 BrowserProcessPlatformPart::browser_policy_connector_chromeos() { |
106 return static_cast<policy::BrowserPolicyConnectorChromeOS*>( | 108 return static_cast<policy::BrowserPolicyConnectorChromeOS*>( |
107 g_browser_process->browser_policy_connector()); | 109 g_browser_process->browser_policy_connector()); |
108 } | 110 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool BrowserProcessPlatformPart::IsCompatibleCrOSComponent( | 164 bool BrowserProcessPlatformPart::IsCompatibleCrOSComponent( |
163 const std::string& name) { | 165 const std::string& name) { |
164 return compatible_cros_components_.count(name) > 0; | 166 return compatible_cros_components_.count(name) > 0; |
165 } | 167 } |
166 | 168 |
167 void BrowserProcessPlatformPart::CreateProfileHelper() { | 169 void BrowserProcessPlatformPart::CreateProfileHelper() { |
168 DCHECK(!created_profile_helper_ && !profile_helper_); | 170 DCHECK(!created_profile_helper_ && !profile_helper_); |
169 created_profile_helper_ = true; | 171 created_profile_helper_ = true; |
170 profile_helper_.reset(new chromeos::ProfileHelper()); | 172 profile_helper_.reset(new chromeos::ProfileHelper()); |
171 } | 173 } |
OLD | NEW |