Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/webui/chromeos/system_info_ui.cc

Issue 10825260: Fix about:system output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 l10n_util::GetStringUTF16(IDS_ABOUT_SYS_COLLAPSE)); 164 l10n_util::GetStringUTF16(IDS_ABOUT_SYS_COLLAPSE));
165 SetFontAndTextDirection(&strings); 165 SetFontAndTextDirection(&strings);
166 166
167 if (logs_ || sys_info_) { 167 if (logs_ || sys_info_) {
168 ListValue* details = new ListValue(); 168 ListValue* details = new ListValue();
169 strings.Set("details", details); 169 strings.Set("details", details);
170 if (logs_) { 170 if (logs_) {
171 chromeos::system::LogDictionaryType::iterator it; 171 chromeos::system::LogDictionaryType::iterator it;
172 for (it = logs_->begin(); it != logs_->end(); ++it) { 172 for (it = logs_->begin(); it != logs_->end(); ++it) {
173 DictionaryValue* val = new DictionaryValue; 173 DictionaryValue* val = new DictionaryValue;
174 // Skip the 'debugd' key; this is a duplicate of all the logs that
175 // we're already getting from the debugd daemon. This will be fixed
176 // with http://code.google.com/p/chromium/issues/detail?id=138582
177 // which incidentally will also remove this code.
178 if (it->first == "debugd")
179 continue;
180
174 val->SetString("stat_name", it->first); 181 val->SetString("stat_name", it->first);
175 val->SetString("stat_value", it->second); 182 val->SetString("stat_value", it->second);
176 details->Append(val); 183 details->Append(val);
177 } 184 }
178 delete logs_; 185 delete logs_;
179 } 186 }
180 if (sys_info_) { 187 if (sys_info_) {
181 chromeos::system::SysInfoResponse::iterator it; 188 chromeos::system::SysInfoResponse::iterator it;
182 for (it = sys_info_->begin(); it != sys_info_->end(); ++it) { 189 for (it = sys_info_->begin(); it != sys_info_->end(); ++it) {
183 DictionaryValue* val = new DictionaryValue; 190 DictionaryValue* val = new DictionaryValue;
184 // Prefix stats coming from debugd with 'debugd-' for now. The code that 191 val->SetString("stat_name", it->first);
185 // displays stats can only handle one stat with a given name, so this
186 // prevents names from overlapping. Once the duplicates have been
187 // removed from userfeedback's list by
188 // <https://gerrit.chromium.org/gerrit/25106>, the prefix can go away.
189 val->SetString("stat_name", "debugd-" + it->first);
190 val->SetString("stat_value", it->second); 192 val->SetString("stat_value", it->second);
191 details->Append(val); 193 details->Append(val);
192 } 194 }
193 delete sys_info_; 195 delete sys_info_;
194 } 196 }
195 strings.SetString("anchor", path_); 197 strings.SetString("anchor", path_);
196 } 198 }
197 static const base::StringPiece systeminfo_html( 199 static const base::StringPiece systeminfo_html(
198 ResourceBundle::GetSharedInstance().GetRawDataResource( 200 ResourceBundle::GetSharedInstance().GetRawDataResource(
199 IDR_ABOUT_SYS_HTML, ui::SCALE_FACTOR_NONE)); 201 IDR_ABOUT_SYS_HTML, ui::SCALE_FACTOR_NONE));
(...skipping 26 matching lines...) Expand all
226 228
227 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { 229 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) {
228 SystemInfoHandler* handler = new SystemInfoHandler(); 230 SystemInfoHandler* handler = new SystemInfoHandler();
229 web_ui->AddMessageHandler(handler); 231 web_ui->AddMessageHandler(handler);
230 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); 232 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource();
231 233
232 // Set up the chrome://system/ source. 234 // Set up the chrome://system/ source.
233 Profile* profile = Profile::FromWebUI(web_ui); 235 Profile* profile = Profile::FromWebUI(web_ui);
234 ChromeURLDataManager::AddDataSource(profile, html_source); 236 ChromeURLDataManager::AddDataSource(profile, html_source);
235 } 237 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698