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/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 using content::WebUIMessageHandler; | 43 using content::WebUIMessageHandler; |
44 | 44 |
45 class SystemInfoUIHTMLSource : public ChromeURLDataManager::DataSource { | 45 class SystemInfoUIHTMLSource : public ChromeURLDataManager::DataSource { |
46 public: | 46 public: |
47 SystemInfoUIHTMLSource(); | 47 SystemInfoUIHTMLSource(); |
48 | 48 |
49 // Called when the network layer has requested a resource underneath | 49 // Called when the network layer has requested a resource underneath |
50 // the path we registered. | 50 // the path we registered. |
51 virtual void StartDataRequest(const std::string& path, | 51 virtual void StartDataRequest(const std::string& path, |
52 bool is_incognito, | 52 bool is_incognito, |
53 int request_id); | 53 int request_id) OVERRIDE; |
54 virtual std::string GetMimeType(const std::string&) const { | 54 virtual std::string GetMimeType(const std::string&) const OVERRIDE { |
55 return "text/html"; | 55 return "text/html"; |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 ~SystemInfoUIHTMLSource() {} | 59 ~SystemInfoUIHTMLSource() {} |
60 | 60 |
61 void SyslogsComplete(chromeos::system::LogDictionaryType* sys_info, | 61 void SyslogsComplete(chromeos::system::LogDictionaryType* sys_info, |
62 std::string* ignored_content); | 62 std::string* ignored_content); |
63 void SysInfoComplete(chromeos::system::SysInfoResponse* response); | 63 void SysInfoComplete(chromeos::system::SysInfoResponse* response); |
64 void RequestComplete(); | 64 void RequestComplete(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 227 SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
228 SystemInfoHandler* handler = new SystemInfoHandler(); | 228 SystemInfoHandler* handler = new SystemInfoHandler(); |
229 web_ui->AddMessageHandler(handler); | 229 web_ui->AddMessageHandler(handler); |
230 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 230 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
231 | 231 |
232 // Set up the chrome://system/ source. | 232 // Set up the chrome://system/ source. |
233 Profile* profile = Profile::FromWebUI(web_ui); | 233 Profile* profile = Profile::FromWebUI(web_ui); |
234 ChromeURLDataManager::AddDataSource(profile, html_source); | 234 ChromeURLDataManager::AddDataSource(profile, html_source); |
235 } | 235 } |
OLD | NEW |