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

Unified Diff: chrome/browser/search/instant_service.h

Issue 14660022: Move most visited item state info from InstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 months 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
« no previous file with comments | « no previous file | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8bd6cbd403497532b37c1014f008cb5697d585b7 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 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);
};
« no previous file with comments | « no previous file | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698