Chromium Code Reviews| Index: chrome/browser/ui/webui/ntp/thumbnail_source.cc |
| =================================================================== |
| --- chrome/browser/ui/webui/ntp/thumbnail_source.cc (revision 176443) |
| +++ chrome/browser/ui/webui/ntp/thumbnail_source.cc (working copy) |
| @@ -10,27 +10,31 @@ |
| #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" |
| #include "ui/base/resource/resource_bundle.h" |
| ThumbnailSource::ThumbnailSource(Profile* profile) |
| - : DataSource(chrome::kChromeUIThumbnailHost, MessageLoop::current()), |
| - // Set ThumbnailService now as Profile isn't thread safe. |
| + : // Set ThumbnailService now as Profile isn't thread safe. |
|
James Hawkins
2013/01/14 19:24:33
nit: One extra space before start of comment.
jam
2013/01/14 20:25:14
Done.
|
| thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)) { |
| } |
| ThumbnailSource::~ThumbnailSource() { |
| } |
| +std::string ThumbnailSource::GetSource() { |
| + return chrome::kChromeUIThumbnailHost; |
| +} |
| + |
| void ThumbnailSource::StartDataRequest(const std::string& path, |
| bool is_incognito, |
| int request_id) { |
| scoped_refptr<base::RefCountedMemory> data; |
| if (thumbnail_service_->GetPageThumbnail(GURL(path), &data)) { |
| // We have the thumbnail. |
| - SendResponse(request_id, data.get()); |
| + url_data_source()->SendResponse(request_id, data.get()); |
| } else { |
| SendDefaultThumbnail(request_id); |
| } |
| @@ -46,9 +50,9 @@ |
| const std::string& path) const { |
| // TopSites can be accessed from the IO thread. |
| return thumbnail_service_.get() ? |
| - NULL : DataSource::MessageLoopForRequestPath(path); |
| + NULL : content::URLDataSourceDelegate::MessageLoopForRequestPath(path); |
| } |
| void ThumbnailSource::SendDefaultThumbnail(int request_id) { |
| - SendResponse(request_id, default_thumbnail_); |
| + url_data_source()->SendResponse(request_id, default_thumbnail_); |
| } |