| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 8 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 11 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
| 12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 13 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 14 #include "base/time.h" | 15 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 path_ = path; | 93 path_ = path; |
| 93 request_id_ = request_id; | 94 request_id_ = request_id; |
| 94 | 95 |
| 95 chromeos::system::SyslogsProvider* provider = | 96 chromeos::system::SyslogsProvider* provider = |
| 96 chromeos::system::SyslogsProvider::GetInstance(); | 97 chromeos::system::SyslogsProvider::GetInstance(); |
| 97 if (provider) { | 98 if (provider) { |
| 98 provider->RequestSyslogs( | 99 provider->RequestSyslogs( |
| 99 false, // don't compress. | 100 false, // don't compress. |
| 100 chromeos::system::SyslogsProvider::SYSLOGS_SYSINFO, | 101 chromeos::system::SyslogsProvider::SYSLOGS_SYSINFO, |
| 101 &consumer_, | 102 &consumer_, |
| 102 NewCallback(this, &SystemInfoUIHTMLSource::SyslogsComplete)); | 103 base::Bind(&SystemInfoUIHTMLSource::SyslogsComplete, |
| 104 base::Unretained(this))); |
| 103 } | 105 } |
| 104 } | 106 } |
| 105 | 107 |
| 106 void SystemInfoUIHTMLSource::SyslogsComplete( | 108 void SystemInfoUIHTMLSource::SyslogsComplete( |
| 107 chromeos::system::LogDictionaryType* sys_info, | 109 chromeos::system::LogDictionaryType* sys_info, |
| 108 std::string* ignored_content) { | 110 std::string* ignored_content) { |
| 109 DCHECK(!ignored_content); | 111 DCHECK(!ignored_content); |
| 110 | 112 |
| 111 DictionaryValue strings; | 113 DictionaryValue strings; |
| 112 strings.SetString("title", l10n_util::GetStringUTF16(IDS_ABOUT_SYS_TITLE)); | 114 strings.SetString("title", l10n_util::GetStringUTF16(IDS_ABOUT_SYS_TITLE)); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 176 |
| 175 SystemInfoUI::SystemInfoUI(TabContents* contents) : ChromeWebUI(contents) { | 177 SystemInfoUI::SystemInfoUI(TabContents* contents) : ChromeWebUI(contents) { |
| 176 SystemInfoHandler* handler = new SystemInfoHandler(); | 178 SystemInfoHandler* handler = new SystemInfoHandler(); |
| 177 AddMessageHandler((handler)->Attach(this)); | 179 AddMessageHandler((handler)->Attach(this)); |
| 178 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 180 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
| 179 | 181 |
| 180 // Set up the chrome://system/ source. | 182 // Set up the chrome://system/ source. |
| 181 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 183 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 182 profile->GetChromeURLDataManager()->AddDataSource(html_source); | 184 profile->GetChromeURLDataManager()->AddDataSource(html_source); |
| 183 } | 185 } |
| OLD | NEW |