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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 private: | 90 private: |
91 DISALLOW_COPY_AND_ASSIGN(SystemInfoHandler); | 91 DISALLOW_COPY_AND_ASSIGN(SystemInfoHandler); |
92 }; | 92 }; |
93 | 93 |
94 //////////////////////////////////////////////////////////////////////////////// | 94 //////////////////////////////////////////////////////////////////////////////// |
95 // | 95 // |
96 // SystemInfoUIHTMLSource | 96 // SystemInfoUIHTMLSource |
97 // | 97 // |
98 //////////////////////////////////////////////////////////////////////////////// | 98 //////////////////////////////////////////////////////////////////////////////// |
99 | 99 |
100 SystemInfoUIHTMLSource::SystemInfoUIHTMLSource() | 100 SystemInfoUIHTMLSource::SystemInfoUIHTMLSource() : weak_ptr_factory_(this) {} |
101 : response_(NULL), | |
102 weak_ptr_factory_(this) { | |
103 } | |
104 | 101 |
105 std::string SystemInfoUIHTMLSource::GetSource() const { | 102 std::string SystemInfoUIHTMLSource::GetSource() const { |
106 return chrome::kChromeUISystemInfoHost; | 103 return chrome::kChromeUISystemInfoHost; |
107 } | 104 } |
108 | 105 |
109 void SystemInfoUIHTMLSource::StartDataRequest( | 106 void SystemInfoUIHTMLSource::StartDataRequest( |
110 const std::string& path, | 107 const std::string& path, |
111 int render_process_id, | 108 int render_process_id, |
112 int render_view_id, | 109 int render_view_id, |
113 const content::URLDataSource::GotDataCallback& callback) { | 110 const content::URLDataSource::GotDataCallback& callback) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 SystemInfoHandler* handler = new SystemInfoHandler(); | 185 SystemInfoHandler* handler = new SystemInfoHandler(); |
189 web_ui->AddMessageHandler(handler); | 186 web_ui->AddMessageHandler(handler); |
190 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); | 187 SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource(); |
191 | 188 |
192 // Set up the chrome://system/ source. | 189 // Set up the chrome://system/ source. |
193 Profile* profile = Profile::FromWebUI(web_ui); | 190 Profile* profile = Profile::FromWebUI(web_ui); |
194 content::URLDataSource::Add(profile, html_source); | 191 content::URLDataSource::Add(profile, html_source); |
195 } | 192 } |
196 | 193 |
197 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |