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 // The bool param is used for knowing weather this function is called during |
rkaplow
2015/03/27 02:33:28
whether
yao
2015/03/27 18:39:45
Done.
| |
199 // startup or not, thus histogram value could be recorded accordingly. | |
200 // TODO(yiyaoliu): Remove this when crbug/223430 is fixed. | |
201 void SetTopSites(const MostVisitedURLList& new_top_sites, bool startup); | |
rkaplow
2015/03/27 02:33:28
it seems kind of messy to me to measure it with a
yao
2015/03/27 18:39:45
It's possible if we only care about execution time
| |
199 | 202 |
200 // Returns the number of most visited results to request from history. This | 203 // Returns the number of most visited results to request from history. This |
201 // changes depending upon how many urls have been blacklisted. Should be | 204 // changes depending upon how many urls have been blacklisted. Should be |
202 // called from the UI thread. | 205 // called from the UI thread. |
203 int num_results_to_request_from_history() const; | 206 int num_results_to_request_from_history() const; |
204 | 207 |
205 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. | 208 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. |
206 // Should be called from the UI thread. | 209 // Should be called from the UI thread. |
207 void MoveStateToLoaded(); | 210 void MoveStateToLoaded(); |
208 | 211 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 | 281 |
279 ScopedObserver<HistoryService, HistoryServiceObserver> | 282 ScopedObserver<HistoryService, HistoryServiceObserver> |
280 history_service_observer_; | 283 history_service_observer_; |
281 | 284 |
282 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); | 285 DISALLOW_COPY_AND_ASSIGN(TopSitesImpl); |
283 }; | 286 }; |
284 | 287 |
285 } // namespace history | 288 } // namespace history |
286 | 289 |
287 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ | 290 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_ |
OLD | NEW |