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

Unified Diff: chrome/browser/bookmarks/chrome_bookmark_client.h

Issue 484213002: Refactor HistoryService to not send NOTIFICATION_FAVICON_CHANGED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android unit tests Created 6 years, 3 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/bookmarks/chrome_bookmark_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/chrome_bookmark_client.h
diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.h b/chrome/browser/bookmarks/chrome_bookmark_client.h
index 30646be27b787c205741aff18f18fdce39fe325e..c9a28b3705f21a4bf079151fbbdd967b834ceab3 100644
--- a/chrome/browser/bookmarks/chrome_bookmark_client.h
+++ b/chrome/browser/bookmarks/chrome_bookmark_client.h
@@ -5,21 +5,23 @@
#ifndef CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
#define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
+#include <set>
#include <vector>
+#include "base/callback_list.h"
#include "base/deferred_sequenced_task_runner.h"
#include "base/macros.h"
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
#include "components/bookmarks/browser/bookmark_client.h"
#include "components/policy/core/browser/managed_bookmarks_tracker.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
class BookmarkModel;
+class GURL;
+class HistoryService;
+class HistoryServiceFactory;
class Profile;
class ChromeBookmarkClient : public bookmarks::BookmarkClient,
- public content::NotificationObserver,
public BaseBookmarkModelObserver {
public:
explicit ChromeBookmarkClient(Profile* profile);
@@ -60,12 +62,10 @@ class ChromeBookmarkClient : public bookmarks::BookmarkClient,
virtual bool CanSyncNode(const BookmarkNode* node) OVERRIDE;
virtual bool CanBeEditedByUser(const BookmarkNode* node) OVERRIDE;
- // content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
private:
+ friend class HistoryServiceFactory;
+ void SetHistoryService(HistoryService* history_service);
+
// BaseBookmarkModelObserver:
virtual void BookmarkModelChanged() OVERRIDE;
virtual void BookmarkNodeRemoved(BookmarkModel* model,
@@ -91,7 +91,13 @@ class ChromeBookmarkClient : public bookmarks::BookmarkClient,
Profile* profile_;
- content::NotificationRegistrar registrar_;
+ // HistoryService associated to the Profile. Due to circular dependency, this
+ // cannot be passed to the constructor, nor lazily fetched. Instead the value
+ // is initialized from HistoryServiceFactory.
+ HistoryService* history_service_;
+
+ scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
+ favicon_changed_subscription_;
// Pointer to the BookmarkModel. Will be non-NULL from the call to Init to
// the call to Shutdown. Must be valid for the whole interval.
« no previous file with comments | « no previous file | chrome/browser/bookmarks/chrome_bookmark_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698