| 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 webui::UseVersion2 version2; | |
| 162 std::string full_html = webui::GetI18nTemplateHtml(systeminfo_html, &strings); | 161 std::string full_html = webui::GetI18nTemplateHtml(systeminfo_html, &strings); |
| 163 callback_.Run(base::RefCountedString::TakeString(&full_html)); | 162 callback_.Run(base::RefCountedString::TakeString(&full_html)); |
| 164 } | 163 } |
| 165 | 164 |
| 166 //////////////////////////////////////////////////////////////////////////////// | 165 //////////////////////////////////////////////////////////////////////////////// |
| 167 // | 166 // |
| 168 // SystemInfoHandler | 167 // SystemInfoHandler |
| 169 // | 168 // |
| 170 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
| 171 SystemInfoHandler::SystemInfoHandler() { | 170 SystemInfoHandler::SystemInfoHandler() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 186 | 185 |
| 187 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 186 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 188 SystemInfoHandler* handler = new SystemInfoHandler(); | 187 SystemInfoHandler* handler = new SystemInfoHandler(); |
| 189 web_ui->AddMessageHandler(handler); | 188 web_ui->AddMessageHandler(handler); |
| 190 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 189 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
| 191 | 190 |
| 192 // Set up the chrome://system/ source. | 191 // Set up the chrome://system/ source. |
| 193 Profile* profile = Profile::FromWebUI(web_ui); | 192 Profile* profile = Profile::FromWebUI(web_ui); |
| 194 content::URLDataSource::Add(profile, html_source); | 193 content::URLDataSource::Add(profile, html_source); |
| 195 } | 194 } |
| OLD | NEW |