| 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> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 friend class base::RefCountedThreadSafe<TopSites>; | 86 friend class base::RefCountedThreadSafe<TopSites>; |
| 87 friend class TopSitesTest; | 87 friend class TopSitesTest; |
| 88 friend class TopSitesTest_GetMostVisited_Test; | 88 friend class TopSitesTest_GetMostVisited_Test; |
| 89 friend class TopSitesTest_RealDatabase_Test; | 89 friend class TopSitesTest_RealDatabase_Test; |
| 90 friend class TopSitesTest_MockDatabase_Test; | 90 friend class TopSitesTest_MockDatabase_Test; |
| 91 | 91 |
| 92 ~TopSites(); | 92 ~TopSites(); |
| 93 | 93 |
| 94 // Called by the public SetPageThumbnail. Takes RefCountedBytes | 94 // Sets the thumbnail without writing to the database. Useful when |
| 95 // rather than a SkBitmap. | 95 // reading last known top sites from the DB. |
| 96 bool SetPageThumbnail(const GURL& url, | 96 // Returns true if the thumbnail was set, false if the existing one is better. |
| 97 const RefCountedBytes* thumbnail_data, | 97 bool SetPageThumbnailNoDB(const GURL& url, |
| 98 const ThumbnailScore& score); | 98 const RefCountedBytes* thumbnail_data, |
| 99 const ThumbnailScore& score); |
| 99 | 100 |
| 100 void StartQueryForMostVisited(); | 101 void StartQueryForMostVisited(); |
| 101 | 102 |
| 102 // Handler for the query response. | 103 // Handler for the query response. |
| 103 void OnTopSitesAvailable(CancelableRequestProvider::Handle handle, | 104 void OnTopSitesAvailable(CancelableRequestProvider::Handle handle, |
| 104 MostVisitedURLList data); | 105 MostVisitedURLList data); |
| 105 | 106 |
| 106 // Updates the top sites list and writes the difference to disk. | 107 // Updates the top sites list and writes the difference to disk. |
| 107 void UpdateMostVisited(MostVisitedURLList* most_visited); | 108 void UpdateMostVisited(MostVisitedURLList* most_visited); |
| 108 // Saves the set of the top URLs visited by this user. The 0th item is the | 109 // Saves the set of the top URLs visited by this user. The 0th item is the |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 177 |
| 177 // TODO(brettw): use the blacklist. | 178 // TODO(brettw): use the blacklist. |
| 178 // std::set<GURL> blacklist_; | 179 // std::set<GURL> blacklist_; |
| 179 | 180 |
| 180 DISALLOW_COPY_AND_ASSIGN(TopSites); | 181 DISALLOW_COPY_AND_ASSIGN(TopSites); |
| 181 }; | 182 }; |
| 182 | 183 |
| 183 } // namespace history | 184 } // namespace history |
| 184 | 185 |
| 185 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 186 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| OLD | NEW |