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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 } // namespace | 183 } // namespace |
184 | 184 |
185 PowerUI::PowerUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { | 185 PowerUI::PowerUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { |
186 web_ui->AddMessageHandler(new PowerMessageHandler()); | 186 web_ui->AddMessageHandler(new PowerMessageHandler()); |
187 | 187 |
188 content::WebUIDataSource* html = | 188 content::WebUIDataSource* html = |
189 content::WebUIDataSource::Create(chrome::kChromeUIPowerHost); | 189 content::WebUIDataSource::Create(chrome::kChromeUIPowerHost); |
190 html->SetUseJsonJSFormatV2(); | |
191 | 190 |
192 html->AddLocalizedString("titleText", IDS_ABOUT_POWER_TITLE); | 191 html->AddLocalizedString("titleText", IDS_ABOUT_POWER_TITLE); |
193 html->AddLocalizedString("showButton", IDS_ABOUT_POWER_SHOW_BUTTON); | 192 html->AddLocalizedString("showButton", IDS_ABOUT_POWER_SHOW_BUTTON); |
194 html->AddLocalizedString("hideButton", IDS_ABOUT_POWER_HIDE_BUTTON); | 193 html->AddLocalizedString("hideButton", IDS_ABOUT_POWER_HIDE_BUTTON); |
195 html->AddLocalizedString("reloadButton", IDS_ABOUT_POWER_RELOAD_BUTTON); | 194 html->AddLocalizedString("reloadButton", IDS_ABOUT_POWER_RELOAD_BUTTON); |
196 html->AddLocalizedString("notEnoughDataAvailableYet", | 195 html->AddLocalizedString("notEnoughDataAvailableYet", |
197 IDS_ABOUT_POWER_NOT_ENOUGH_DATA); | 196 IDS_ABOUT_POWER_NOT_ENOUGH_DATA); |
198 html->AddLocalizedString("systemSuspended", | 197 html->AddLocalizedString("systemSuspended", |
199 IDS_ABOUT_POWER_SYSTEM_SUSPENDED); | 198 IDS_ABOUT_POWER_SYSTEM_SUSPENDED); |
200 html->AddLocalizedString("invalidData", IDS_ABOUT_POWER_INVALID); | 199 html->AddLocalizedString("invalidData", IDS_ABOUT_POWER_INVALID); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 html->SetDefaultResource(IDR_ABOUT_POWER_HTML); | 233 html->SetDefaultResource(IDR_ABOUT_POWER_HTML); |
235 | 234 |
236 Profile* profile = Profile::FromWebUI(web_ui); | 235 Profile* profile = Profile::FromWebUI(web_ui); |
237 content::WebUIDataSource::Add(profile, html); | 236 content::WebUIDataSource::Add(profile, html); |
238 } | 237 } |
239 | 238 |
240 PowerUI::~PowerUI() { | 239 PowerUI::~PowerUI() { |
241 } | 240 } |
242 | 241 |
243 } // namespace chromeos | 242 } // namespace chromeos |
OLD | NEW |