| Index: chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
|
| diff --git a/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc b/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
|
| index 8b15821ee93ca946d35158a3b3d4f0c1b6c098b4..b43a9e9d57941200a7c8fd4ade3fd1a2d7fa5994 100644
|
| --- a/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
|
| +++ b/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
|
| @@ -15,10 +15,8 @@
|
| DOMUIThumbnailSource::DOMUIThumbnailSource(Profile* profile)
|
| : DataSource(chrome::kChromeUIThumbnailPath, MessageLoop::current()),
|
| profile_(profile) {
|
| - if (history::TopSites::IsEnabled()) {
|
| - // Set TopSites now as Profile isn't thread safe.
|
| - top_sites_ = profile_->GetTopSites();
|
| - }
|
| + // Set TopSites now as Profile isn't thread safe.
|
| + top_sites_ = profile_->GetTopSites();
|
| }
|
|
|
| DOMUIThumbnailSource::~DOMUIThumbnailSource() {
|
| @@ -27,28 +25,12 @@ DOMUIThumbnailSource::~DOMUIThumbnailSource() {
|
| void DOMUIThumbnailSource::StartDataRequest(const std::string& path,
|
| bool is_off_the_record,
|
| int request_id) {
|
| - if (top_sites_.get()) {
|
| - scoped_refptr<RefCountedBytes> data;
|
| - if (top_sites_->GetPageThumbnail(GURL(path), &data)) {
|
| - // We have the thumbnail.
|
| - SendResponse(request_id, data.get());
|
| - } else {
|
| - SendDefaultThumbnail(request_id);
|
| - }
|
| - return;
|
| - }
|
| -
|
| - HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| - if (hs) {
|
| - HistoryService::Handle handle = hs->GetPageThumbnail(
|
| - GURL(path),
|
| - &cancelable_consumer_,
|
| - NewCallback(this, &DOMUIThumbnailSource::OnThumbnailDataAvailable));
|
| - // Attach the ChromeURLDataManager request ID to the history request.
|
| - cancelable_consumer_.SetClientData(hs, handle, request_id);
|
| + scoped_refptr<RefCountedBytes> data;
|
| + if (top_sites_->GetPageThumbnail(GURL(path), &data)) {
|
| + // We have the thumbnail.
|
| + SendResponse(request_id, data.get());
|
| } else {
|
| - // Tell the caller that no thumbnail is available.
|
| - SendResponse(request_id, NULL);
|
| + SendDefaultThumbnail(request_id);
|
| }
|
| }
|
|
|
| @@ -73,15 +55,3 @@ void DOMUIThumbnailSource::SendDefaultThumbnail(int request_id) {
|
| }
|
| SendResponse(request_id, default_thumbnail_);
|
| }
|
| -
|
| -void DOMUIThumbnailSource::OnThumbnailDataAvailable(
|
| - HistoryService::Handle request_handle,
|
| - scoped_refptr<RefCountedBytes> data) {
|
| - int request_id = cancelable_consumer_.GetClientDataForCurrentRequest();
|
| - // Forward the data along to the networking system.
|
| - if (data.get() && !data->data.empty()) {
|
| - SendResponse(request_id, data);
|
| - } else {
|
| - SendDefaultThumbnail(request_id);
|
| - }
|
| -}
|
|
|