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

Side by Side Diff: extensions/browser/api/system_cpu/system_cpu_api.cc

Issue 389633002: Move system.* family of APIs to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No ash/ dependency anymore Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 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 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 "base/command_line.h"
6 #include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h" 6 #include "extensions/browser/api/system_cpu/cpu_info_provider.h"
7 #include "chrome/browser/extensions/api/system_cpu/system_cpu_api.h" 7 #include "extensions/browser/api/system_cpu/system_cpu_api.h"
8 #include "chrome/common/chrome_switches.h"
9 #include "extensions/common/features/base_feature_provider.h" 8 #include "extensions/common/features/base_feature_provider.h"
10 9
11 namespace extensions { 10 namespace extensions {
12 11
13 using api::system_cpu::CpuInfo; 12 using core_api::system_cpu::CpuInfo;
14 13
15 SystemCpuGetInfoFunction::SystemCpuGetInfoFunction() { 14 SystemCpuGetInfoFunction::SystemCpuGetInfoFunction() {
16 } 15 }
17 16
18 SystemCpuGetInfoFunction::~SystemCpuGetInfoFunction() { 17 SystemCpuGetInfoFunction::~SystemCpuGetInfoFunction() {
19 } 18 }
20 19
21 bool SystemCpuGetInfoFunction::RunAsync() { 20 bool SystemCpuGetInfoFunction::RunAsync() {
22 CpuInfoProvider::Get()->StartQueryInfo( 21 CpuInfoProvider::Get()->StartQueryInfo(
23 base::Bind(&SystemCpuGetInfoFunction::OnGetCpuInfoCompleted, this)); 22 base::Bind(&SystemCpuGetInfoFunction::OnGetCpuInfoCompleted, this));
24 return true; 23 return true;
25 } 24 }
26 25
27 void SystemCpuGetInfoFunction::OnGetCpuInfoCompleted(bool success) { 26 void SystemCpuGetInfoFunction::OnGetCpuInfoCompleted(bool success) {
28 if (success) 27 if (success)
29 SetResult(CpuInfoProvider::Get()->cpu_info().ToValue().release()); 28 SetResult(CpuInfoProvider::Get()->cpu_info().ToValue().release());
30 else 29 else
31 SetError("Error occurred when querying cpu information."); 30 SetError("Error occurred when querying cpu information.");
32 SendResponse(success); 31 SendResponse(success);
33 } 32 }
34 33
35 } // namespace extensions 34 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698