Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/gtest_prod_util.h" | |
| 14 #include "base/lock.h" | 15 #include "base/lock.h" |
| 15 #include "base/timer.h" | 16 #include "base/timer.h" |
| 16 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 17 #include "base/ref_counted_memory.h" | 18 #include "base/ref_counted_memory.h" |
| 18 #include "chrome/browser/cancelable_request.h" | 19 #include "chrome/browser/cancelable_request.h" |
| 19 #include "chrome/browser/history/history_types.h" | 20 #include "chrome/browser/history/history_types.h" |
| 20 #include "chrome/browser/history/history.h" | 21 #include "chrome/browser/history/history.h" |
| 21 #include "chrome/browser/history/page_usage_data.h" | 22 #include "chrome/browser/history/page_usage_data.h" |
| 22 #include "chrome/common/notification_service.h" | 23 #include "chrome/common/notification_service.h" |
| 23 #include "chrome/common/thumbnail_score.h" | 24 #include "chrome/common/thumbnail_score.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 97 |
| 97 // For testing with a HistoryService mock. | 98 // For testing with a HistoryService mock. |
| 98 void SetMockHistoryService(MockHistoryService* mhs); | 99 void SetMockHistoryService(MockHistoryService* mhs); |
| 99 | 100 |
| 100 // Start reading thumbnails from the ThumbnailDatabase. | 101 // Start reading thumbnails from the ThumbnailDatabase. |
| 101 void StartMigration(); | 102 void StartMigration(); |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 friend class base::RefCountedThreadSafe<TopSites>; | 105 friend class base::RefCountedThreadSafe<TopSites>; |
| 105 friend class TopSitesTest; | 106 friend class TopSitesTest; |
| 106 friend class TopSitesTest_GetMostVisited_Test; | 107 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetMostVisited); |
| 107 friend class TopSitesTest_RealDatabase_Test; | 108 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, RealDatabase); |
| 108 friend class TopSitesTest_MockDatabase_Test; | 109 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, MockDatabase); |
| 109 friend class TopSitesTest_DeleteNotifications_Test; | 110 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, DeleteNotifications); |
| 110 friend class TopSitesTest_GetUpdateDelay_Test; | 111 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetUpdateDelay); |
| 111 friend class TopSitesTest_Migration_Test; | 112 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, MigrationTest); |
|
gavinp
2010/07/23 00:11:29
FRIEND_TEST_ALL_PREFIXES(TopSitesTest, Migration);
| |
| 112 friend class TopSitesTest_QueueingRequestsForTopSites_Test; | 113 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, QueueingRequestsForTopSites); |
| 113 friend class TopSitesTest_CancelingRequestsForTopSites_Test; | 114 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, CancelingRequestsForTopSites); |
| 114 friend class TopSitesTest_AddTemporaryThumbnail_Test; | 115 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, AddTemporaryThumbnail); |
| 115 | 116 |
| 116 ~TopSites(); | 117 ~TopSites(); |
| 117 | 118 |
| 118 // Sets the thumbnail without writing to the database. Useful when | 119 // Sets the thumbnail without writing to the database. Useful when |
| 119 // reading last known top sites from the DB. | 120 // reading last known top sites from the DB. |
| 120 // Returns true if the thumbnail was set, false if the existing one is better. | 121 // Returns true if the thumbnail was set, false if the existing one is better. |
| 121 bool SetPageThumbnailNoDB(const GURL& url, | 122 bool SetPageThumbnailNoDB(const GURL& url, |
| 122 const RefCountedBytes* thumbnail_data, | 123 const RefCountedBytes* thumbnail_data, |
| 123 const ThumbnailScore& score); | 124 const ThumbnailScore& score); |
| 124 | 125 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 | 272 |
| 272 // TODO(brettw): use the blacklist. | 273 // TODO(brettw): use the blacklist. |
| 273 // std::set<GURL> blacklist_; | 274 // std::set<GURL> blacklist_; |
| 274 | 275 |
| 275 DISALLOW_COPY_AND_ASSIGN(TopSites); | 276 DISALLOW_COPY_AND_ASSIGN(TopSites); |
| 276 }; | 277 }; |
| 277 | 278 |
| 278 } // namespace history | 279 } // namespace history |
| 279 | 280 |
| 280 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 281 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| OLD | NEW |