OLD | NEW |
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 "chrome/browser/ui/webui/system_info_ui.h" | 5 #include "chrome/browser/ui/webui/system_info_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/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ++it) { | 151 ++it) { |
152 base::DictionaryValue* val = new base::DictionaryValue; | 152 base::DictionaryValue* val = new base::DictionaryValue; |
153 val->SetString("statName", it->first); | 153 val->SetString("statName", it->first); |
154 val->SetString("statValue", it->second); | 154 val->SetString("statValue", it->second); |
155 details->Append(val); | 155 details->Append(val); |
156 } | 156 } |
157 } | 157 } |
158 static const base::StringPiece systeminfo_html( | 158 static const base::StringPiece systeminfo_html( |
159 ResourceBundle::GetSharedInstance().GetRawDataResource( | 159 ResourceBundle::GetSharedInstance().GetRawDataResource( |
160 IDR_ABOUT_SYS_HTML)); | 160 IDR_ABOUT_SYS_HTML)); |
161 std::string full_html = webui::GetTemplatesHtml( | 161 webui::UseVersion2 version2; |
162 systeminfo_html, &strings, "t" /* template root node id */); | 162 std::string full_html = webui::GetI18nTemplateHtml(systeminfo_html, &strings); |
163 callback_.Run(base::RefCountedString::TakeString(&full_html)); | 163 callback_.Run(base::RefCountedString::TakeString(&full_html)); |
164 } | 164 } |
165 | 165 |
166 //////////////////////////////////////////////////////////////////////////////// | 166 //////////////////////////////////////////////////////////////////////////////// |
167 // | 167 // |
168 // SystemInfoHandler | 168 // SystemInfoHandler |
169 // | 169 // |
170 //////////////////////////////////////////////////////////////////////////////// | 170 //////////////////////////////////////////////////////////////////////////////// |
171 SystemInfoHandler::SystemInfoHandler() { | 171 SystemInfoHandler::SystemInfoHandler() { |
172 } | 172 } |
(...skipping 13 matching lines...) Expand all Loading... |
186 | 186 |
187 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 187 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
188 SystemInfoHandler* handler = new SystemInfoHandler(); | 188 SystemInfoHandler* handler = new SystemInfoHandler(); |
189 web_ui->AddMessageHandler(handler); | 189 web_ui->AddMessageHandler(handler); |
190 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 190 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
191 | 191 |
192 // Set up the chrome://system/ source. | 192 // Set up the chrome://system/ source. |
193 Profile* profile = Profile::FromWebUI(web_ui); | 193 Profile* profile = Profile::FromWebUI(web_ui); |
194 content::URLDataSource::Add(profile, html_source); | 194 content::URLDataSource::Add(profile, html_source); |
195 } | 195 } |
OLD | NEW |