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

Unified Diff: chrome/browser/ui/webui/chromeos/system_info_ui.cc

Issue 11885021: Don't derive from ChromeURLDataManager::DataSource, and instead have these classes implement a dele… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/system_info_ui.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/system_info_ui.cc (revision 176443)
+++ chrome/browser/ui/webui/chromeos/system_info_ui.cc (working copy)
@@ -25,6 +25,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/url_data_source_delegate.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -42,12 +43,12 @@
namespace chromeos {
-class SystemInfoUIHTMLSource : public ChromeURLDataManager::DataSource {
+class SystemInfoUIHTMLSource : public content::URLDataSourceDelegate {
public:
SystemInfoUIHTMLSource();
- // Called when the network layer has requested a resource underneath
- // the path we registered.
+ // content::URLDataSourceDelegate implementation.
+ virtual std::string GetSource() OVERRIDE;
virtual void StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) OVERRIDE;
@@ -92,12 +93,15 @@
////////////////////////////////////////////////////////////////////////////////
SystemInfoUIHTMLSource::SystemInfoUIHTMLSource()
- : DataSource(chrome::kChromeUISystemInfoHost, MessageLoop::current()),
- request_id_(0),
+ : request_id_(0),
response_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
}
+std::string SystemInfoUIHTMLSource::GetSource() {
+ return chrome::kChromeUISystemInfoHost;
+}
+
void SystemInfoUIHTMLSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
@@ -131,7 +135,7 @@
l10n_util::GetStringUTF16(IDS_ABOUT_SYS_EXPAND));
strings.SetString("collapse_btn",
l10n_util::GetStringUTF16(IDS_ABOUT_SYS_COLLAPSE));
- SetFontAndTextDirection(&strings);
+ URLDataSource::SetFontAndTextDirection(&strings);
if (response_.get()) {
ListValue* details = new ListValue();
strings.Set("details", details);
@@ -150,7 +154,8 @@
IDR_ABOUT_SYS_HTML));
std::string full_html = jstemplate_builder::GetTemplatesHtml(
systeminfo_html, &strings, "t" /* template root node id */);
- SendResponse(request_id_, base::RefCountedString::TakeString(&full_html));
+ url_data_source()->SendResponse(
+ request_id_, base::RefCountedString::TakeString(&full_html));
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698