Index: chrome/browser/search/instant_service.h |
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h |
index 14738fcae98b47df4870a5aa21875c5f21523254..c86e32809558d8bada24559bf41222f390882e0a 100644 |
--- a/chrome/browser/search/instant_service.h |
+++ b/chrome/browser/search/instant_service.h |
@@ -12,6 +12,8 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/history/history_types.h" |
#include "chrome/browser/profiles/profile_keyed_service.h" |
#include "chrome/common/instant_restricted_id_cache.h" |
#include "content/public/browser/notification_observer.h" |
@@ -62,17 +64,24 @@ class InstantService : public ProfileKeyedService, |
// the process. |
void AddMostVisitedItems(const std::vector<InstantMostVisitedItem>& items); |
+ // Invoked by the InstantController when the Instant page wants to delete a |
+ // Most Visited item. |
+ void DeleteMostVisitedItem(const GURL& item_url); |
+ |
+ // Invoked by the InstantController when the Instant page wants to undo the |
+ // blacklist action. |
+ void UndoMostVisitedDeletion(const GURL& most_visited_item_url); |
+ |
+ // Invoked by the InstantController when the Instant page wants to undo all |
+ // Most Visited deletions. |
+ void UndoAllMostVisitedDeletions(); |
+ |
// Returns the last added InstantMostVisitedItems. After the call to |
// |AddMostVisitedItems|, the caller should call this to get the items with |
// the assigned IDs. |
void GetCurrentMostVisitedItems( |
std::vector<InstantMostVisitedItemIDPair>* items) const; |
- // If the |most_visited_item_id| is found in the cache, sets the |item| to it |
- // and returns true. |
- bool GetMostVisitedItemForID(InstantRestrictedID most_visited_item_id, |
- InstantMostVisitedItem* item) const; |
- |
private: |
// Overridden from ProfileKeyedService: |
virtual void Shutdown() OVERRIDE; |
@@ -82,6 +91,20 @@ class InstantService : public ProfileKeyedService, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // If the |most_visited_item_id| is found in the cache, sets the |item| to it |
+ // and returns true. |
+ bool GetMostVisitedItemForID(InstantRestrictedID most_visited_item_id, |
+ InstantMostVisitedItem* item) const; |
+ |
+ // Called when we get new most visited items from the TopNav code, |
+ // registered as an async callback. Parses them and sends them to the renderer |
+ // via SendMostVisitedItems. |
+ void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); |
+ |
+ // Sends a collection of MostVisitedItems to the renderer process via the |
+ // InstantController. |
+ void SendMostVisitedItems(); |
+ |
Profile* const profile_; |
// The process ids associated with Instant processes. |
@@ -94,6 +117,9 @@ class InstantService : public ProfileKeyedService, |
scoped_refptr<InstantIOContext> instant_io_context_; |
+ // Used for Top Sites async retrieval. |
+ base::WeakPtrFactory<InstantService> weak_ptr_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(InstantService); |
}; |