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

Unified Diff: chrome/browser/ui/webui/chromeos/proxy_settings_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/proxy_settings_ui.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc (revision 176443)
+++ chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc (working copy)
@@ -16,6 +16,7 @@
#include "chrome/browser/ui/webui/options/chromeos/proxy_handler.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"
@@ -27,12 +28,12 @@
namespace {
-class ProxySettingsHTMLSource : public ChromeURLDataManager::DataSource {
+class ProxySettingsHTMLSource : public content::URLDataSourceDelegate {
public:
explicit ProxySettingsHTMLSource(DictionaryValue* localized_strings);
- // 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;
@@ -51,14 +52,17 @@
ProxySettingsHTMLSource::ProxySettingsHTMLSource(
DictionaryValue* localized_strings)
- : DataSource(chrome::kChromeUIProxySettingsHost, MessageLoop::current()),
- localized_strings_(localized_strings) {
+ : localized_strings_(localized_strings) {
}
+std::string ProxySettingsHTMLSource::GetSource() {
+ return chrome::kChromeUIProxySettingsHost;
+}
+
void ProxySettingsHTMLSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- SetFontAndTextDirection(localized_strings_.get());
+ URLDataSource::SetFontAndTextDirection(localized_strings_.get());
static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
@@ -66,7 +70,8 @@
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
html, localized_strings_.get());
- SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
+ url_data_source()->SendResponse(
+ request_id, base::RefCountedString::TakeString(&full_html));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698