OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 // Executes all of the callbacks in |pending_callbacks|. This is used after | 289 // Executes all of the callbacks in |pending_callbacks|. This is used after |
290 // we finish loading if any requests came in before we loaded. | 290 // we finish loading if any requests came in before we loaded. |
291 static void ProcessPendingCallbacks( | 291 static void ProcessPendingCallbacks( |
292 const PendingCallbackSet& pending_callbacks, | 292 const PendingCallbackSet& pending_callbacks, |
293 const MostVisitedURLList& urls); | 293 const MostVisitedURLList& urls); |
294 | 294 |
295 // Implementation of content::NotificationObserver. | 295 // Implementation of content::NotificationObserver. |
296 virtual void Observe(int type, | 296 virtual void Observe(int type, |
297 const content::NotificationSource& source, | 297 const content::NotificationSource& source, |
298 const content::NotificationDetails& details); | 298 const content::NotificationDetails& details) OVERRIDE; |
299 | 299 |
300 // Resets top_sites_ and updates the db (in the background). All mutations to | 300 // Resets top_sites_ and updates the db (in the background). All mutations to |
301 // top_sites_ *must* go through this. | 301 // top_sites_ *must* go through this. |
302 void SetTopSites(const MostVisitedURLList& new_top_sites); | 302 void SetTopSites(const MostVisitedURLList& new_top_sites); |
303 | 303 |
304 // Returns the number of most visted results to request from history. This | 304 // Returns the number of most visted results to request from history. This |
305 // changes depending upon how many urls have been blacklisted. | 305 // changes depending upon how many urls have been blacklisted. |
306 int num_results_to_request_from_history() const; | 306 int num_results_to_request_from_history() const; |
307 | 307 |
308 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. | 308 // Invoked when transitioning to LOADED. Notifies any queued up callbacks. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 bool loaded_; | 398 bool loaded_; |
399 | 399 |
400 DISALLOW_COPY_AND_ASSIGN(TopSites); | 400 DISALLOW_COPY_AND_ASSIGN(TopSites); |
401 }; | 401 }; |
402 | 402 |
403 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 403 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
404 | 404 |
405 } // namespace history | 405 } // namespace history |
406 | 406 |
407 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 407 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
OLD | NEW |