| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // is a URL pinned at |index|. | 135 // is a URL pinned at |index|. |
| 136 bool GetPinnedURLAtIndex(size_t index, GURL* out); | 136 bool GetPinnedURLAtIndex(size_t index, GURL* out); |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 friend class base::RefCountedThreadSafe<TopSites>; | 139 friend class base::RefCountedThreadSafe<TopSites>; |
| 140 friend class TopSitesTest; | 140 friend class TopSitesTest; |
| 141 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetMostVisited); | 141 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetMostVisited); |
| 142 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, RealDatabase); | 142 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, RealDatabase); |
| 143 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, MockDatabase); | 143 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, MockDatabase); |
| 144 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, DeleteNotifications); | 144 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, DeleteNotifications); |
| 145 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, PinnedURLsDeleted); |
| 145 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetUpdateDelay); | 146 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetUpdateDelay); |
| 146 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, Migration); | 147 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, Migration); |
| 147 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, QueueingRequestsForTopSites); | 148 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, QueueingRequestsForTopSites); |
| 148 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, CancelingRequestsForTopSites); | 149 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, CancelingRequestsForTopSites); |
| 149 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, AddTemporaryThumbnail); | 150 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, AddTemporaryThumbnail); |
| 150 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, Blacklisting); | 151 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, Blacklisting); |
| 151 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, PinnedURLs); | 152 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, PinnedURLs); |
| 152 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, BlacklistingAndPinnedURLs); | 153 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, BlacklistingAndPinnedURLs); |
| 153 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, AddPrepopulatedPages); | 154 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, AddPrepopulatedPages); |
| 154 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetIndexForChromeStore); | 155 FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetIndexForChromeStore); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 176 void StartQueryForThumbnail(size_t index); | 177 void StartQueryForThumbnail(size_t index); |
| 177 | 178 |
| 178 // Called when history service returns a list of top URLs. | 179 // Called when history service returns a list of top URLs. |
| 179 void OnTopSitesAvailable(CancelableRequestProvider::Handle handle, | 180 void OnTopSitesAvailable(CancelableRequestProvider::Handle handle, |
| 180 MostVisitedURLList data); | 181 MostVisitedURLList data); |
| 181 | 182 |
| 182 // Called when history service returns a thumbnail. | 183 // Called when history service returns a thumbnail. |
| 183 void OnThumbnailAvailable(CancelableRequestProvider::Handle handle, | 184 void OnThumbnailAvailable(CancelableRequestProvider::Handle handle, |
| 184 scoped_refptr<RefCountedBytes> thumbnail); | 185 scoped_refptr<RefCountedBytes> thumbnail); |
| 185 | 186 |
| 187 // Sets canonical_urls_ from top_sites_. |
| 188 void GenerateCanonicalURLs(); |
| 189 |
| 186 // Saves the set of the top URLs visited by this user. The 0th item is the | 190 // Saves the set of the top URLs visited by this user. The 0th item is the |
| 187 // most popular. | 191 // most popular. |
| 188 // DANGER! This will clear all data from the input argument. | 192 // DANGER! This will clear all data from the input argument. |
| 189 void StoreMostVisited(MostVisitedURLList* most_visited); | 193 void StoreMostVisited(MostVisitedURLList* most_visited); |
| 190 | 194 |
| 191 // Saves the given set of redirects. The redirects are in order of the | 195 // Saves the given set of redirects. The redirects are in order of the |
| 192 // given vector, so [0] -> [1] -> [2]. | 196 // given vector, so [0] -> [1] -> [2]. |
| 193 void StoreRedirectChain(const RedirectList& redirects, | 197 void StoreRedirectChain(const RedirectList& redirects, |
| 194 size_t destination); | 198 size_t destination); |
| 195 | 199 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // index where it is pinned at (may be the same as key). This is | 354 // index where it is pinned at (may be the same as key). This is |
| 351 // owned by the PrefService. | 355 // owned by the PrefService. |
| 352 DictionaryValue* pinned_urls_; | 356 DictionaryValue* pinned_urls_; |
| 353 | 357 |
| 354 DISALLOW_COPY_AND_ASSIGN(TopSites); | 358 DISALLOW_COPY_AND_ASSIGN(TopSites); |
| 355 }; | 359 }; |
| 356 | 360 |
| 357 } // namespace history | 361 } // namespace history |
| 358 | 362 |
| 359 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 363 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| OLD | NEW |