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

Unified Diff: chrome/browser/dom_ui/dom_ui_thumbnail_source.cc

Issue 6283001: Remove TopSites::IsEnabled() as well as related dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove OnThumbnailDataAvailable Created 9 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
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_thumbnail_source.h ('k') | chrome/browser/dom_ui/most_visited_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
- }
-}
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_thumbnail_source.h ('k') | chrome/browser/dom_ui/most_visited_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698