Chromium Code Reviews| Index: chrome/browser/search/instant_service.h |
| diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h |
| index 78a87dbedf8cca38d1e7f9d02145130c37fb7b3d..42d3150543d2c702bfcc80dd527dfbd40e031b3a 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/common/instant_restricted_id_cache.h" |
| #include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
| #include "content/public/browser/notification_observer.h" |
| @@ -62,17 +64,24 @@ class InstantService : public BrowserContextKeyedService, |
| // 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& url); |
| + |
| + // Invoked by the InstantController when the Instant page wants to undo the |
| + // blacklist action. |
| + void UndoMostVisitedDeletion(const GURL& 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 BrowserContextKeyedService: |
| virtual void Shutdown() OVERRIDE; |
| @@ -82,6 +91,16 @@ class InstantService : public BrowserContextKeyedService, |
| 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, |
|
sreeram
2013/06/03 20:40:42
TopNav? Did you mean TopSites?
kmadhusu
2013/06/03 21:40:49
Changed TopNav ->TopSites.
|
| + // registered as an async callback. Parses them and sends them to the renderer |
| + // via SendMostVisitedItems. |
| + void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); |
| + |
| Profile* const profile_; |
| // The process ids associated with Instant processes. |
| @@ -94,6 +113,9 @@ class InstantService : public BrowserContextKeyedService, |
| scoped_refptr<InstantIOContext> instant_io_context_; |
| + // Used for Top Sites async retrieval. |
| + base::WeakPtrFactory<InstantService> weak_ptr_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(InstantService); |
| }; |