| Index: chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
|
| ===================================================================
|
| --- chrome/browser/dom_ui/dom_ui_thumbnail_source.cc (revision 19748)
|
| +++ chrome/browser/dom_ui/dom_ui_thumbnail_source.cc (working copy)
|
| @@ -21,20 +21,15 @@
|
| store_(profile->GetThumbnailStore()) {
|
| }
|
|
|
| -DOMUIThumbnailSource::~DOMUIThumbnailSource() {
|
| - store_->CancelPendingRequests(pending_requests_);
|
| -}
|
| -
|
| void DOMUIThumbnailSource::StartDataRequest(const std::string& path,
|
| int request_id) {
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kThumbnailStore)) {
|
| RefCountedBytes* data = NULL;
|
|
|
| - ThumbnailStore::GetStatus res = store_->GetPageThumbnail(GURL(path), &data);
|
| - if (res == ThumbnailStore::SUCCESS) {
|
| + if (store_->GetPageThumbnail(GURL(path), &data)) {
|
| // Got the thumbnail.
|
| SendResponse(request_id, data);
|
| - } else if (res == ThumbnailStore::FAIL) {
|
| + } else {
|
| // Don't have the thumbnail so return the default thumbnail.
|
| if (!default_thumbnail_.get()) {
|
| default_thumbnail_ = new RefCountedBytes;
|
| @@ -42,12 +37,6 @@
|
| IDR_DEFAULT_THUMBNAIL, &default_thumbnail_->data);
|
| }
|
| SendResponse(request_id, default_thumbnail_);
|
| - } else if (res == ThumbnailStore::ASYNC) {
|
| - // Getting the redirect list for the url. Will return thumbnail later.
|
| - ThumbnailStore::ThumbnailDataCallback* cb =
|
| - NewCallback(this, &DOMUIThumbnailSource::ReturnData);
|
| - pending_requests_.insert(request_id);
|
| - store_->GetPageThumbnailAsync(GURL(path), request_id, cb);
|
| }
|
| return;
|
| } // end --thumbnail-store switch
|
| @@ -66,22 +55,6 @@
|
| }
|
| }
|
|
|
| -void DOMUIThumbnailSource::ReturnData(int request_id,
|
| - scoped_refptr<RefCountedBytes> data) {
|
| - pending_requests_.erase(request_id);
|
| - if (data.get() && !data->data.empty()) {
|
| - SendResponse(request_id, data);
|
| - } else {
|
| - if (!default_thumbnail_.get()) {
|
| - default_thumbnail_ = new RefCountedBytes;
|
| - ResourceBundle::GetSharedInstance().LoadImageResourceBytes(
|
| - IDR_DEFAULT_THUMBNAIL, &default_thumbnail_->data);
|
| - }
|
| -
|
| - SendResponse(request_id, default_thumbnail_);
|
| - }
|
| -}
|
| -
|
| void DOMUIThumbnailSource::OnThumbnailDataAvailable(
|
| HistoryService::Handle request_handle,
|
| scoped_refptr<RefCountedBytes> data) {
|
|
|