Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include <base/file_util.h> |
| 6 | |
| 7 | #include "update_engine/system_state.h" |
| 8 | |
| 9 | namespace chromeos_update_engine { |
| 10 | |
| 11 | static const char kOOBECompletedMarker[] = "/home/chronos/.oobe_completed"; |
| 12 | |
Jay Srinivasan | 34b5d86 | 2012-07-23 11:43:22 -0700 | [diff] [blame] | 13 | RealSystemState::RealSystemState() |
| 14 | : device_policy_(NULL), |
Jay Srinivasan | f057205 | 2012-10-23 18:12:56 -0700 | [diff] [blame] | 15 | connection_manager_(this), |
| 16 | metrics_lib_(NULL) {} |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 17 | |
| 18 | bool RealSystemState::IsOOBEComplete() { |
| 19 | return file_util::PathExists(FilePath(kOOBECompletedMarker)); |
| 20 | } |
| 21 | |
| 22 | void RealSystemState::SetDevicePolicy( |
| 23 | const policy::DevicePolicy* device_policy) { |
| 24 | device_policy_ = device_policy; |
| 25 | } |
| 26 | |
| 27 | const policy::DevicePolicy* RealSystemState::GetDevicePolicy() const { |
| 28 | return device_policy_; |
| 29 | } |
| 30 | |
| 31 | ConnectionManager* RealSystemState::GetConnectionManager() { |
| 32 | return &connection_manager_; |
| 33 | } |
| 34 | |
Jay Srinivasan | f057205 | 2012-10-23 18:12:56 -0700 | [diff] [blame] | 35 | void RealSystemState::set_metrics_lib(MetricsLibraryInterface* metrics_lib) { |
| 36 | metrics_lib_ = metrics_lib; |
| 37 | } |
| 38 | |
| 39 | MetricsLibraryInterface* RealSystemState::metrics_lib() { |
| 40 | return metrics_lib_; |
| 41 | } |
| 42 | |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 43 | } // namespace chromeos_update_engine |