OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/webui/chromeos/power_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/power_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 const char kRequestCpuFreqDataCallback[] = "requestCpuFreqData"; | 36 const char kRequestCpuFreqDataCallback[] = "requestCpuFreqData"; |
37 const char kOnRequestCpuFreqDataFunction[] = | 37 const char kOnRequestCpuFreqDataFunction[] = |
38 "powerUI.showCpuFreqData"; | 38 "powerUI.showCpuFreqData"; |
39 | 39 |
40 class PowerMessageHandler : public content::WebUIMessageHandler { | 40 class PowerMessageHandler : public content::WebUIMessageHandler { |
41 public: | 41 public: |
42 PowerMessageHandler(); | 42 PowerMessageHandler(); |
43 virtual ~PowerMessageHandler(); | 43 virtual ~PowerMessageHandler(); |
44 | 44 |
45 // WebUIMessageHandler implementation. | 45 // WebUIMessageHandler implementation. |
46 virtual void RegisterMessages() OVERRIDE; | 46 virtual void RegisterMessages() override; |
47 | 47 |
48 private: | 48 private: |
49 void OnGetBatteryChargeData(const base::ListValue* value); | 49 void OnGetBatteryChargeData(const base::ListValue* value); |
50 void OnGetCpuIdleData(const base::ListValue* value); | 50 void OnGetCpuIdleData(const base::ListValue* value); |
51 void OnGetCpuFreqData(const base::ListValue* value); | 51 void OnGetCpuFreqData(const base::ListValue* value); |
52 void GetJsStateOccupancyData( | 52 void GetJsStateOccupancyData( |
53 const std::vector<CpuDataCollector::StateOccupancySampleDeque>& data, | 53 const std::vector<CpuDataCollector::StateOccupancySampleDeque>& data, |
54 const std::vector<std::string>& state_names, | 54 const std::vector<std::string>& state_names, |
55 base::ListValue* js_data); | 55 base::ListValue* js_data); |
56 void GetJsSystemResumedData(base::ListValue* value); | 56 void GetJsSystemResumedData(base::ListValue* value); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 html->SetDefaultResource(IDR_ABOUT_POWER_HTML); | 233 html->SetDefaultResource(IDR_ABOUT_POWER_HTML); |
234 | 234 |
235 Profile* profile = Profile::FromWebUI(web_ui); | 235 Profile* profile = Profile::FromWebUI(web_ui); |
236 content::WebUIDataSource::Add(profile, html); | 236 content::WebUIDataSource::Add(profile, html); |
237 } | 237 } |
238 | 238 |
239 PowerUI::~PowerUI() { | 239 PowerUI::~PowerUI() { |
240 } | 240 } |
241 | 241 |
242 } // namespace chromeos | 242 } // namespace chromeos |
OLD | NEW |