| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ |
| 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ | 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "base/task/cancelable_task_tracker.h" |
| 19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 20 #include "base/timer/timer.h" | 21 #include "base/timer/timer.h" |
| 21 #include "chrome/browser/common/cancelable_request.h" | 22 #include "chrome/browser/common/cancelable_request.h" |
| 22 #include "chrome/browser/history/history_service.h" | 23 #include "chrome/browser/history/history_service.h" |
| 23 #include "chrome/browser/history/history_types.h" | 24 #include "chrome/browser/history/history_types.h" |
| 24 #include "chrome/browser/history/page_usage_data.h" | 25 #include "chrome/browser/history/page_usage_data.h" |
| 25 #include "chrome/browser/history/top_sites.h" | 26 #include "chrome/browser/history/top_sites.h" |
| 26 #include "chrome/browser/history/top_sites_backend.h" | 27 #include "chrome/browser/history/top_sites_backend.h" |
| 27 #include "chrome/common/cancelable_task_tracker.h" | |
| 28 #include "chrome/common/thumbnail_score.h" | 28 #include "chrome/common/thumbnail_score.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "ui/gfx/image/image.h" | 30 #include "ui/gfx/image/image.h" |
| 31 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 32 | 32 |
| 33 class Profile; | 33 class Profile; |
| 34 | 34 |
| 35 namespace base { | 35 namespace base { |
| 36 class FilePath; | 36 class FilePath; |
| 37 class RefCountedBytes; | 37 class RefCountedBytes; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 scoped_ptr<TopSitesCache> thread_safe_cache_; | 230 scoped_ptr<TopSitesCache> thread_safe_cache_; |
| 231 | 231 |
| 232 Profile* profile_; | 232 Profile* profile_; |
| 233 | 233 |
| 234 // Lock used to access |thread_safe_cache_|. | 234 // Lock used to access |thread_safe_cache_|. |
| 235 mutable base::Lock lock_; | 235 mutable base::Lock lock_; |
| 236 | 236 |
| 237 // Need a separate consumer for each CancelableRequestProvider we interact | 237 // Need a separate consumer for each CancelableRequestProvider we interact |
| 238 // with (HistoryService and TopSitesBackend). | 238 // with (HistoryService and TopSitesBackend). |
| 239 CancelableRequestConsumer history_consumer_; | 239 CancelableRequestConsumer history_consumer_; |
| 240 CancelableTaskTracker cancelable_task_tracker_; | 240 base::CancelableTaskTracker cancelable_task_tracker_; |
| 241 | 241 |
| 242 // Timer that asks history for the top sites. This is used to make sure our | 242 // Timer that asks history for the top sites. This is used to make sure our |
| 243 // data stays in sync with history. | 243 // data stays in sync with history. |
| 244 base::OneShotTimer<TopSitesImpl> timer_; | 244 base::OneShotTimer<TopSitesImpl> timer_; |
| 245 | 245 |
| 246 // The time we started |timer_| at. Only valid if |timer_| is running. | 246 // The time we started |timer_| at. Only valid if |timer_| is running. |
| 247 base::TimeTicks timer_start_time_; | 247 base::TimeTicks timer_start_time_; |
| 248 | 248 |
| 249 content::NotificationRegistrar registrar_; | 249 content::NotificationRegistrar registrar_; |
| 250 | 250 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 267 | 267 |
| 268 // Are we loaded? | 268 // Are we loaded? |
| 269 bool loaded_; | 269 bool loaded_; |
| 270 | 270 |
| 271 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); | 271 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 } // namespace history | 274 } // namespace history |
| 275 | 275 |
| 276 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ | 276 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ |
| OLD | NEW |