| 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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/lifetime/keep_alive_types.h" | 24 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 25 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 25 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chromeos/geolocation/simple_geolocation_provider.h" | 28 #include "chromeos/geolocation/simple_geolocation_provider.h" |
| 29 #include "chromeos/timezone/timezone_resolver.h" | 29 #include "chromeos/timezone/timezone_resolver.h" |
| 30 #include "components/session_manager/core/session_manager.h" | 30 #include "components/session_manager/core/session_manager.h" |
| 31 #include "components/user_manager/user_manager.h" | 31 #include "components/user_manager/user_manager.h" |
| 32 | 32 |
| 33 BrowserProcessPlatformPart::BrowserProcessPlatformPart() | 33 BrowserProcessPlatformPart::BrowserProcessPlatformPart() |
| 34 : created_profile_helper_(false) { | 34 : created_profile_helper_(false) {} |
| 35 } | |
| 36 | 35 |
| 37 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { | 36 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {} |
| 38 } | |
| 39 | 37 |
| 40 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { | 38 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { |
| 41 DCHECK(!automatic_reboot_manager_); | 39 DCHECK(!automatic_reboot_manager_); |
| 42 | 40 |
| 43 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( | 41 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( |
| 44 std::unique_ptr<base::TickClock>(new base::DefaultTickClock))); | 42 std::unique_ptr<base::TickClock>(new base::DefaultTickClock))); |
| 45 } | 43 } |
| 46 | 44 |
| 47 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { | 45 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { |
| 48 automatic_reboot_manager_.reset(); | 46 automatic_reboot_manager_.reset(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 chromeos::SimpleGeolocationProvider::DefaultGeolocationProviderURL(), | 133 chromeos::SimpleGeolocationProvider::DefaultGeolocationProviderURL(), |
| 136 base::Bind(&chromeos::system::ApplyTimeZone), | 134 base::Bind(&chromeos::system::ApplyTimeZone), |
| 137 base::Bind(&chromeos::DelayNetworkCall, | 135 base::Bind(&chromeos::DelayNetworkCall, |
| 138 base::TimeDelta::FromMilliseconds( | 136 base::TimeDelta::FromMilliseconds( |
| 139 chromeos::kDefaultNetworkRetryDelayMS)), | 137 chromeos::kDefaultNetworkRetryDelayMS)), |
| 140 g_browser_process->local_state())); | 138 g_browser_process->local_state())); |
| 141 } | 139 } |
| 142 return timezone_resolver_.get(); | 140 return timezone_resolver_.get(); |
| 143 } | 141 } |
| 144 | 142 |
| 145 chromeos::system::SystemClock* BrowserProcessPlatformPart::GetSystemClock() { | |
| 146 if (!system_clock_.get()) | |
| 147 system_clock_.reset(new chromeos::system::SystemClock()); | |
| 148 | |
| 149 return system_clock_.get(); | |
| 150 } | |
| 151 void BrowserProcessPlatformPart::StartTearDown() { | 143 void BrowserProcessPlatformPart::StartTearDown() { |
| 152 // interactive_ui_tests check for memory leaks before this object is | 144 // interactive_ui_tests check for memory leaks before this object is |
| 153 // destroyed. So we need to destroy |timezone_resolver_| here. | 145 // destroyed. So we need to destroy |timezone_resolver_| here. |
| 154 timezone_resolver_.reset(); | 146 timezone_resolver_.reset(); |
| 155 profile_helper_.reset(); | 147 profile_helper_.reset(); |
| 156 } | 148 } |
| 157 | 149 |
| 158 std::unique_ptr<policy::BrowserPolicyConnector> | 150 std::unique_ptr<policy::BrowserPolicyConnector> |
| 159 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { | 151 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { |
| 160 return std::unique_ptr<policy::BrowserPolicyConnector>( | 152 return std::unique_ptr<policy::BrowserPolicyConnector>( |
| 161 new policy::BrowserPolicyConnectorChromeOS()); | 153 new policy::BrowserPolicyConnectorChromeOS()); |
| 162 } | 154 } |
| 163 | 155 |
| 156 chromeos::system::SystemClock* BrowserProcessPlatformPart::GetSystemClock() { |
| 157 if (!system_clock_.get()) |
| 158 system_clock_.reset(new chromeos::system::SystemClock()); |
| 159 return system_clock_.get(); |
| 160 } |
| 161 |
| 162 void BrowserProcessPlatformPart::DestroySystemClock() { |
| 163 system_clock_.reset(); |
| 164 } |
| 165 |
| 164 void BrowserProcessPlatformPart::CreateProfileHelper() { | 166 void BrowserProcessPlatformPart::CreateProfileHelper() { |
| 165 DCHECK(!created_profile_helper_ && !profile_helper_); | 167 DCHECK(!created_profile_helper_ && !profile_helper_); |
| 166 created_profile_helper_ = true; | 168 created_profile_helper_ = true; |
| 167 profile_helper_.reset(new chromeos::ProfileHelper()); | 169 profile_helper_.reset(new chromeos::ProfileHelper()); |
| 168 } | 170 } |
| OLD | NEW |