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

Unified Diff: chrome/browser/ui/webui/web_ui_browsertest.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/web_ui_browsertest.cc
===================================================================
--- chrome/browser/ui/webui/web_ui_browsertest.cc (revision 176942)
+++ chrome/browser/ui/webui/web_ui_browsertest.cc (working copy)
@@ -28,7 +28,7 @@
#include "chrome/test/base/test_tab_strip_model_observer.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/navigation_controller.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_controller.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -268,7 +268,7 @@
// page is shown. While this doesn't matter for most tests, without it,
// navigation to different anchors cannot be listened to (via the hashchange
// event).
-class MockWebUIDataSource : public content::URLDataSourceDelegate {
+class MockWebUIDataSource : public content::URLDataSource {
public:
MockWebUIDataSource() {}
@@ -279,13 +279,14 @@
return "dummyurl";
}
- virtual void StartDataRequest(const std::string& path,
- bool is_incognito,
- int request_id) OVERRIDE {
+ virtual void StartDataRequest(
+ const std::string& path,
+ bool is_incognito,
+ const content::URLDataSource::GotDataCallback& callback) OVERRIDE {
std::string dummy_html = "<html><body>Dummy</body></html>";
scoped_refptr<base::RefCountedString> response =
base::RefCountedString::TakeString(&dummy_html);
- url_data_source()->SendResponse(request_id, response);
+ callback.Run(response);
}
std::string GetMimeType(const std::string& path) const OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698