| Index: extensions/browser/api/system_cpu/cpu_info_provider.cc
|
| diff --git a/extensions/browser/api/system_cpu/cpu_info_provider.cc b/extensions/browser/api/system_cpu/cpu_info_provider.cc
|
| index e926aaac66be2398f62a9c15ada10caaa43b5c88..aca7c2a5eed976b2af09ce255223a7a5bcbc7c9b 100644
|
| --- a/extensions/browser/api/system_cpu/cpu_info_provider.cc
|
| +++ b/extensions/browser/api/system_cpu/cpu_info_provider.cc
|
| @@ -6,6 +6,10 @@
|
|
|
| #include "base/sys_info.h"
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chromeos/system/cpu_temperature_reader.h"
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| namespace extensions {
|
|
|
| using api::system_cpu::CpuInfo;
|
| @@ -39,6 +43,19 @@ bool CpuInfoProvider::QueryInfo() {
|
| // Initialize the ProcessorInfos, or return an empty array if that fails.
|
| if (!QueryCpuTimePerProcessor(&info_.processors))
|
| info_.processors.clear();
|
| +
|
| +#if defined(OS_CHROMEOS)
|
| + using CPUTemperatureInfo =
|
| + chromeos::system::CPUTemperatureReader::CPUTemperatureInfo;
|
| + std::vector<CPUTemperatureInfo> cpu_temp_info =
|
| + chromeos::system::CPUTemperatureReader().GetCPUTemperatures();
|
| + info_.temperatures.clear();
|
| + info_.temperatures.reserve(cpu_temp_info.size());
|
| + for (const CPUTemperatureInfo& info : cpu_temp_info) {
|
| + info_.temperatures.push_back(info.temp_celsius);
|
| + }
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| return true;
|
| }
|
|
|
|
|