| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/history/top_sites.h" | 5 #include "chrome/browser/history/top_sites.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 virtual void DoneRunOnMainThread() { | 113 virtual void DoneRunOnMainThread() { |
| 114 top_sites_->FinishHistoryMigration(data_); | 114 top_sites_->FinishHistoryMigration(data_); |
| 115 } | 115 } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 virtual ~LoadThumbnailsFromHistoryTask() {} |
| 119 |
| 118 bool ShouldFetchThumbnailFor(const GURL& url) { | 120 bool ShouldFetchThumbnailFor(const GURL& url) { |
| 119 return ignore_urls_.find(url.spec()) == ignore_urls_.end(); | 121 return ignore_urls_.find(url.spec()) == ignore_urls_.end(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 // Set of URLs we don't load thumbnails for. This is created on the UI thread | 124 // Set of URLs we don't load thumbnails for. This is created on the UI thread |
| 123 // and used on the history thread. | 125 // and used on the history thread. |
| 124 std::set<std::string> ignore_urls_; | 126 std::set<std::string> ignore_urls_; |
| 125 | 127 |
| 126 scoped_refptr<TopSites> top_sites_; | 128 scoped_refptr<TopSites> top_sites_; |
| 127 | 129 |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 SetTopSites(pages); | 1040 SetTopSites(pages); |
| 1039 | 1041 |
| 1040 // Used only in testing. | 1042 // Used only in testing. |
| 1041 content::NotificationService::current()->Notify( | 1043 content::NotificationService::current()->Notify( |
| 1042 chrome::NOTIFICATION_TOP_SITES_UPDATED, | 1044 chrome::NOTIFICATION_TOP_SITES_UPDATED, |
| 1043 content::Source<TopSites>(this), | 1045 content::Source<TopSites>(this), |
| 1044 content::Details<CancelableRequestProvider::Handle>(&handle)); | 1046 content::Details<CancelableRequestProvider::Handle>(&handle)); |
| 1045 } | 1047 } |
| 1046 | 1048 |
| 1047 } // namespace history | 1049 } // namespace history |
| OLD | NEW |