Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.cc

Issue 15817008: Move systemInfo.cpu API out out experimental namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new enum values rather than renaming existing ones Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h"
5 #include "chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h" 6 #include "chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h"
6
7 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" 7 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h"
8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/extensions/features/base_feature_provider.h"
8 10
9 namespace extensions { 11 namespace extensions {
10 12
11 using api::experimental_system_info_cpu::CpuInfo; 13 using api::system_info_cpu::CpuInfo;
12 14
13 SystemInfoCpuGetFunction::SystemInfoCpuGetFunction() { 15 SystemInfoCpuGetFunction::SystemInfoCpuGetFunction() {
14 } 16 }
15 17
16 SystemInfoCpuGetFunction::~SystemInfoCpuGetFunction() { 18 SystemInfoCpuGetFunction::~SystemInfoCpuGetFunction() {
17 } 19 }
18 20
19 bool SystemInfoCpuGetFunction::RunImpl() { 21 bool SystemInfoCpuGetFunction::RunImpl() {
20 CpuInfoProvider::Get()->StartQueryInfo( 22 CpuInfoProvider::Get()->StartQueryInfo(
21 base::Bind(&SystemInfoCpuGetFunction::OnGetCpuInfoCompleted, this)); 23 base::Bind(&SystemInfoCpuGetFunction::OnGetCpuInfoCompleted, this));
22 return true; 24 return true;
23 } 25 }
24 26
25 void SystemInfoCpuGetFunction::OnGetCpuInfoCompleted(const CpuInfo& info, 27 void SystemInfoCpuGetFunction::OnGetCpuInfoCompleted(const CpuInfo& info,
26 bool success) { 28 bool success) {
27 if (success) 29 if (success)
28 SetResult(info.ToValue().release()); 30 SetResult(info.ToValue().release());
29 else 31 else
30 SetError("Error occurred when querying cpu information."); 32 SetError("Error occurred when querying cpu information.");
31 SendResponse(success); 33 SendResponse(success);
32 } 34 }
33 35
34 } // namespace extensions 36 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698