1 // Copyright 2013 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 "base/command_line.h"
6 #include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h"
7 #include "chrome/browser/extensions/api/system_cpu/system_cpu_api.h"
8 #include "chrome/common/chrome_switches.h"
9 #include "extensions/common/features/base_feature_provider.h"
11 namespace extensions
{
13 using api::system_cpu::CpuInfo
;
15 SystemCpuGetInfoFunction::SystemCpuGetInfoFunction() {
18 SystemCpuGetInfoFunction::~SystemCpuGetInfoFunction() {
21 bool SystemCpuGetInfoFunction::RunImpl() {
22 CpuInfoProvider::Get()->StartQueryInfo(
23 base::Bind(&SystemCpuGetInfoFunction::OnGetCpuInfoCompleted
, this));
27 void SystemCpuGetInfoFunction::OnGetCpuInfoCompleted(bool success
) {
29 SetResult(CpuInfoProvider::Get()->cpu_info().ToValue().release());
31 SetError("Error occurred when querying cpu information.");
32 SendResponse(success
);
35 } // namespace extensions