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

Unified Diff: chrome/browser/ui/webui/bookmarks_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: fix WebUISourcesTest unittest 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/bookmarks_ui.cc
===================================================================
--- chrome/browser/ui/webui/bookmarks_ui.cc (revision 176443)
+++ chrome/browser/ui/webui/bookmarks_ui.cc (working copy)
@@ -19,17 +19,20 @@
//
////////////////////////////////////////////////////////////////////////////////
-BookmarksUIHTMLSource::BookmarksUIHTMLSource()
- : DataSource(chrome::kChromeUIBookmarksHost, MessageLoop::current()) {
+BookmarksUIHTMLSource::BookmarksUIHTMLSource() {
}
+std::string BookmarksUIHTMLSource::GetSource() {
+ return chrome::kChromeUIBookmarksHost;
+}
+
void BookmarksUIHTMLSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
NOTREACHED() << "We should never get here since the extension should have"
<< "been triggered";
- SendResponse(request_id, NULL);
+ url_data_source()->SendResponse(request_id, NULL);
}
std::string BookmarksUIHTMLSource::GetMimeType(const std::string& path) const {
@@ -47,11 +50,10 @@
////////////////////////////////////////////////////////////////////////////////
BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
- BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource();
-
// Set up the chrome://bookmarks/ source.
- Profile* profile = Profile::FromWebUI(web_ui);
- ChromeURLDataManager::AddDataSource(profile, html_source);
+ ChromeURLDataManager::AddDataSource(
+ Profile::FromWebUI(web_ui),
+ new BookmarksUIHTMLSource);
}
// static

Powered by Google App Engine
This is Rietveld 408576698