1 // Copyright 2015 The Chromium 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.
5 #include "chromeos/system/devicetype.h"
9 #include "base/sys_info.h"
14 const char kDeviceType
[] = "CHROMEOS_DEVICE_TYPE";
17 DeviceType
GetDeviceType() {
19 if (base::SysInfo::GetLsbReleaseValue(kDeviceType
, &value
)) {
20 if (value
== "CHROMEBASE")
21 return DeviceType::kChromebase
;
22 else if (value
== "CHROMEBIT")
23 return DeviceType::kChromebit
;
24 // Most devices are Chromebooks, so we will also consider reference boards
26 else if (value
== "CHROMEBOOK" || value
== "REFERENCE")
27 return DeviceType::kChromebook
;
28 else if (value
== "CHROMEBOX")
29 return DeviceType::kChromebox
;
31 LOG(ERROR
) << "Unknown device type \"" << value
<< "\"";
34 return DeviceType::kUnknown
;
37 } // namespace chromeos