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

Unified Diff: chrome/browser/ui/webui/chromeos/sim_unlock_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/sim_unlock_ui.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc (revision 176443)
+++ chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.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"
@@ -70,12 +71,12 @@
namespace chromeos {
-class SimUnlockUIHTMLSource : public ChromeURLDataManager::DataSource {
+class SimUnlockUIHTMLSource : public content::URLDataSourceDelegate {
public:
SimUnlockUIHTMLSource();
- // 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;
@@ -245,10 +246,13 @@
// SimUnlockUIHTMLSource -------------------------------------------------------
-SimUnlockUIHTMLSource::SimUnlockUIHTMLSource()
- : DataSource(chrome::kChromeUISimUnlockHost, MessageLoop::current()) {
+SimUnlockUIHTMLSource::SimUnlockUIHTMLSource() {
}
+std::string SimUnlockUIHTMLSource::GetSource() {
+ return chrome::kChromeUISimUnlockHost;
+}
+
void SimUnlockUIHTMLSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
@@ -305,7 +309,7 @@
strings.SetString("oldPin", l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN));
- SetFontAndTextDirection(&strings);
+ URLDataSource::SetFontAndTextDirection(&strings);
static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
@@ -314,7 +318,8 @@
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html,
&strings);
- SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
+ url_data_source()->SendResponse(
+ request_id, base::RefCountedString::TakeString(&full_html));
}
// SimUnlockHandler ------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698