Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4889)

Unified Diff: chrome/browser/history/top_sites.h

Issue 5088001: Add pyauto hook for getting and manipulating the data underneath the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/functional
Patch Set: change hook, remove ntp_model Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/top_sites.h
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index bd406f10a9f164847396d6342d397cdffdb567e4..4c28e7be37ccd635b53d72c8093e92adfd0e5beb 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -13,10 +13,10 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/lock.h"
-#include "base/time.h"
-#include "base/timer.h"
#include "base/ref_counted.h"
#include "base/ref_counted_memory.h"
+#include "base/time.h"
+#include "base/timer.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/history/history_types.h"
@@ -141,6 +141,11 @@ class TopSites
const MostVisitedURLList& new_list,
TopSitesDelta* delta);
+ // Query history service for the list of available thumbnails. Returns the
+ // handle for the request, or NULL if a request could not be made.
+ // Public only for testing purposes.
+ CancelableRequestProvider::Handle StartQueryForMostVisited();
+
private:
friend class base::RefCountedThreadSafe<TopSites>;
friend class TopSitesTest;
@@ -203,8 +208,8 @@ class TopSites
const RefCountedBytes* thumbnail,
const ThumbnailScore& score);
- // Query history service for the list of available thumbnails.
- void StartQueryForMostVisited();
+ // Called by our timer. Starts the query for the most visited sites.
+ void TimerFired();
// Finds the given URL in the redirect chain for the given TopSite, and
// returns the distance from the destination in hops that the given URL is.
@@ -291,6 +296,10 @@ class TopSites
// pinned urls applied (|cache_| does not).
scoped_ptr<TopSitesCache> thread_safe_cache_;
+ // Invokes the callback signaling the cache has been completely refreshed.
+ // This is only used for testing.
+ void InvokeRefreshCallback(CancelableRequestProvider::Handle handle);
+
Profile* profile_;
// Lock used to access |thread_safe_cache_|.

Powered by Google App Engine
This is Rietveld 408576698