| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 4 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "chrome/browser/extensions/api/system_info/system_info_provider.h" | 10 #include "chrome/browser/extensions/api/system_info/system_info_provider.h" |
| 11 #include "chrome/common/extensions/api/system_info_cpu.h" | 11 #include "chrome/common/extensions/api/system_info_cpu.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class CpuInfoProvider | 15 class CpuInfoProvider |
| 16 : public SystemInfoProvider<api::system_info_cpu::CpuInfo> { | 16 : public SystemInfoProvider<api::system_info_cpu::CpuInfo> { |
| 17 public: | 17 public: |
| 18 // Overriden from SystemInfoProvider<CpuInfo>. | 18 // Overriden from SystemInfoProvider<CpuInfo>. |
| 19 virtual bool QueryInfo( | 19 virtual bool QueryInfo() OVERRIDE; |
| 20 api::system_info_cpu::CpuInfo* info) OVERRIDE; | |
| 21 | 20 |
| 22 // Return the single shared instance of CpuInfoProvider. | 21 // Return the single shared instance of CpuInfoProvider. |
| 23 static CpuInfoProvider* Get(); | 22 static CpuInfoProvider* Get(); |
| 24 | 23 |
| 24 const api::system_info_cpu::CpuInfo& cpu_info() const; |
| 25 |
| 25 private: | 26 private: |
| 26 friend class SystemInfoProvider<api::system_info_cpu::CpuInfo>; | 27 friend class SystemInfoProvider<api::system_info_cpu::CpuInfo>; |
| 27 friend class MockCpuInfoProviderImpl; | 28 friend class MockCpuInfoProviderImpl; |
| 28 friend class TestCpuInfoProvider; | 29 friend class TestCpuInfoProvider; |
| 29 | 30 |
| 30 CpuInfoProvider(); | 31 CpuInfoProvider(); |
| 31 | 32 |
| 32 virtual ~CpuInfoProvider(); | 33 virtual ~CpuInfoProvider(); |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace extensions | 36 } // namespace extensions |
| 36 | 37 |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 38 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 38 | 39 |
| OLD | NEW |