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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_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/ntp/new_tab_ui.cc
===================================================================
--- chrome/browser/ui/webui/ntp/new_tab_ui.cc (revision 176942)
+++ chrome/browser/ui/webui/ntp/new_tab_ui.cc (working copy)
@@ -26,7 +26,6 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h"
#include "chrome/browser/ui/webui/ntp/foreign_session_handler.h"
@@ -369,9 +368,10 @@
return chrome::kChromeUINewTabHost;
}
-void NewTabUI::NewTabHTMLSource::StartDataRequest(const std::string& path,
- bool is_incognito,
- int request_id) {
+void NewTabUI::NewTabHTMLSource::StartDataRequest(
+ const std::string& path,
+ bool is_incognito,
+ const content::URLDataSource::GotDataCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::map<std::string, std::pair<std::string, int> >::iterator it =
@@ -382,7 +382,7 @@
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
it->second.second) :
new base::RefCountedStaticMemory);
- url_data_source()->SendResponse(request_id, resource_bytes);
+ callback.Run(resource_bytes);
return;
}
@@ -404,7 +404,7 @@
NTPResourceCacheFactory::GetForProfile(profile_)->
GetNewTabHTML(is_incognito));
- url_data_source()->SendResponse(request_id, html_bytes);
+ callback.Run(html_bytes);
}
std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string& resource)

Powered by Google App Engine
This is Rietveld 408576698