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

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

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests 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/register_page_ui.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/register_page_ui.cc (revision 176942)
+++ chrome/browser/ui/webui/chromeos/register_page_ui.cc (working copy)
@@ -24,10 +24,9 @@
#include "chrome/browser/chromeos/system/statistics_provider.h"
#include "chrome/browser/chromeos/version_loader.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/url_constants.h"
-#include "content/public/browser/url_data_source_delegate.h"
+#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -96,15 +95,16 @@
} // namespace
-class RegisterPageUIHTMLSource : public content::URLDataSourceDelegate {
+class RegisterPageUIHTMLSource : public content::URLDataSource {
public:
RegisterPageUIHTMLSource();
- // content::URLDataSourceDelegate implementation.
+ // content::URLDataSource implementation.
virtual std::string GetSource() OVERRIDE;
- virtual void StartDataRequest(const std::string& path,
- bool is_incognito,
- int request_id);
+ virtual void StartDataRequest(
+ const std::string& path,
+ bool is_incognito,
+ const content::URLDataSource::GotDataCallback& callback);
virtual std::string GetMimeType(const std::string&) const {
return "text/html";
}
@@ -163,15 +163,16 @@
return chrome::kChromeUIRegisterPageHost;
}
-void RegisterPageUIHTMLSource::StartDataRequest(const std::string& path,
- bool is_incognito,
- int request_id) {
+void RegisterPageUIHTMLSource::StartDataRequest(
+ const std::string& path,
+ bool is_incognito,
+ const content::URLDataSource::GotDataCallback& callback) {
// Make sure that chrome://register is available only during
// OOBE wizard lifetime and when device has not been registered yet.
if (!chromeos::WizardController::default_controller() ||
chromeos::WizardController::IsDeviceRegistered()) {
scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes);
- url_data_source()->SendResponse(request_id, empty_bytes);
+ callback.Run(empty_bytes);
return;
}
@@ -179,7 +180,7 @@
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
IDR_HOST_REGISTRATION_PAGE_HTML));
- url_data_source()->SendResponse(request_id, html_bytes);
+ callback.Run(html_bytes);
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698