| 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 | 4 |
| 5 #include "chrome/browser/ui/webui/chromeos/system_info_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 DictionaryValue* val = new DictionaryValue; | 146 DictionaryValue* val = new DictionaryValue; |
| 147 val->SetString("stat_name", it->first); | 147 val->SetString("stat_name", it->first); |
| 148 val->SetString("stat_value", it->second); | 148 val->SetString("stat_value", it->second); |
| 149 details->Append(val); | 149 details->Append(val); |
| 150 } | 150 } |
| 151 strings.SetString("anchor", path_); | 151 strings.SetString("anchor", path_); |
| 152 } | 152 } |
| 153 static const base::StringPiece systeminfo_html( | 153 static const base::StringPiece systeminfo_html( |
| 154 ResourceBundle::GetSharedInstance().GetRawDataResource( | 154 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 155 IDR_ABOUT_SYS_HTML)); | 155 IDR_ABOUT_SYS_HTML)); |
| 156 std::string full_html = jstemplate_builder::GetTemplatesHtml( | 156 std::string full_html = webui::GetTemplatesHtml( |
| 157 systeminfo_html, &strings, "t" /* template root node id */); | 157 systeminfo_html, &strings, "t" /* template root node id */); |
| 158 callback_.Run(base::RefCountedString::TakeString(&full_html)); | 158 callback_.Run(base::RefCountedString::TakeString(&full_html)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
| 162 // | 162 // |
| 163 // SystemInfoHandler | 163 // SystemInfoHandler |
| 164 // | 164 // |
| 165 //////////////////////////////////////////////////////////////////////////////// | 165 //////////////////////////////////////////////////////////////////////////////// |
| 166 SystemInfoHandler::SystemInfoHandler() { | 166 SystemInfoHandler::SystemInfoHandler() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 183 SystemInfoHandler* handler = new SystemInfoHandler(); | 183 SystemInfoHandler* handler = new SystemInfoHandler(); |
| 184 web_ui->AddMessageHandler(handler); | 184 web_ui->AddMessageHandler(handler); |
| 185 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 185 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
| 186 | 186 |
| 187 // Set up the chrome://system/ source. | 187 // Set up the chrome://system/ source. |
| 188 Profile* profile = Profile::FromWebUI(web_ui); | 188 Profile* profile = Profile::FromWebUI(web_ui); |
| 189 ChromeURLDataManager::AddDataSource(profile, html_source); | 189 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace chromeos | 192 } // namespace chromeos |
| OLD | NEW |