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

Unified Diff: chrome/browser/ui/webui/ntp/thumbnail_source.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/thumbnail_source.cc
===================================================================
--- chrome/browser/ui/webui/ntp/thumbnail_source.cc (revision 176942)
+++ chrome/browser/ui/webui/ntp/thumbnail_source.cc (working copy)
@@ -10,7 +10,6 @@
#include "chrome/browser/thumbnails/thumbnail_service.h"
#include "chrome/browser/thumbnails/thumbnail_service_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
#include "grit/theme_resources.h"
@@ -28,15 +27,16 @@
return chrome::kChromeUIThumbnailHost;
}
-void ThumbnailSource::StartDataRequest(const std::string& path,
- bool is_incognito,
- int request_id) {
+void ThumbnailSource::StartDataRequest(
+ const std::string& path,
+ bool is_incognito,
+ const content::URLDataSource::GotDataCallback& callback) {
scoped_refptr<base::RefCountedMemory> data;
if (thumbnail_service_->GetPageThumbnail(GURL(path), &data)) {
// We have the thumbnail.
- url_data_source()->SendResponse(request_id, data.get());
+ callback.Run(data.get());
} else {
- SendDefaultThumbnail(request_id);
+ callback.Run(default_thumbnail_);
}
}
@@ -50,9 +50,5 @@
const std::string& path) const {
// TopSites can be accessed from the IO thread.
return thumbnail_service_.get() ?
- NULL : content::URLDataSourceDelegate::MessageLoopForRequestPath(path);
+ NULL : content::URLDataSource::MessageLoopForRequestPath(path);
}
-
-void ThumbnailSource::SendDefaultThumbnail(int request_id) {
- url_data_source()->SendResponse(request_id, default_thumbnail_);
-}

Powered by Google App Engine
This is Rietveld 408576698