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> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void Observe(int type, | 188 void Observe(int type, |
189 const content::NotificationSource& source, | 189 const content::NotificationSource& source, |
190 const content::NotificationDetails& details) override; | 190 const content::NotificationDetails& details) override; |
191 | 191 |
192 // Updates URLs in |cache_| and the db (in the background). | 192 // Updates URLs in |cache_| and the db (in the background). |
193 // The non-forced URLs in |new_top_sites| replace those in |cache_|. | 193 // The non-forced URLs in |new_top_sites| replace those in |cache_|. |
194 // The forced URLs of |new_top_sites| are merged with those in |cache_|, | 194 // The forced URLs of |new_top_sites| are merged with those in |cache_|, |
195 // if the list of forced URLs overflows, the oldest ones are dropped. | 195 // if the list of forced URLs overflows, the oldest ones are dropped. |
196 // All mutations to cache_ *must* go through this. Should | 196 // All mutations to cache_ *must* go through this. Should |
197 // be called from the UI thread. | 197 // be called from the UI thread. |
198 void SetTopSites(const MostVisitedURLList& new_top_sites); | 198 // TODO(yiyaoliu): Remove the 2nd parameter when crbug/223430 is fixed. |
| 199 void SetTopSites(const MostVisitedURLList& new_top_sites, |
| 200 const TopSitesBackend::TopSitesCalledLocation location); |
199 | 201 |
200 // Returns the number of most visited results to request from history. This | 202 // Returns the number of most visited results to request from history. This |
201 // changes depending upon how many urls have been blacklisted. Should be | 203 // changes depending upon how many urls have been blacklisted. Should be |
202 // called from the UI thread. | 204 // called from the UI thread. |
203 int num_results_to_request_from_history() const; | 205 int num_results_to_request_from_history() const; |
204 | 206 |
205 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. | 207 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. |
206 // Should be called from the UI thread. | 208 // Should be called from the UI thread. |
207 void MoveStateToLoaded(); | 209 void MoveStateToLoaded(); |
208 | 210 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 280 |
279 ScopedObserver<HistoryService, HistoryServiceObserver> | 281 ScopedObserver<HistoryService, HistoryServiceObserver> |
280 history_service_observer_; | 282 history_service_observer_; |
281 | 283 |
282 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); | 284 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); |
283 }; | 285 }; |
284 | 286 |
285 } // namespace history | 287 } // namespace history |
286 | 288 |
287 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ | 289 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ |
OLD | NEW |