Index: chrome/browser/win/jumplist.h |
diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h |
index 738832c4aa54294c2217cf7c083272ea06875975..bb5befa04024914c82a71f71a93fc7a966aa7aa0 100644 |
--- a/chrome/browser/win/jumplist.h |
+++ b/chrome/browser/win/jumplist.h |
@@ -23,6 +23,7 @@ |
#include "components/history/core/browser/history_service.h" |
#include "components/history/core/browser/history_types.h" |
#include "components/history/core/browser/top_sites_observer.h" |
+#include "components/keyed_service/core/refcounted_keyed_service.h" |
#include "components/sessions/core/tab_restore_service.h" |
#include "components/sessions/core/tab_restore_service_observer.h" |
#include "content/public/browser/browser_thread.h" |
@@ -33,6 +34,7 @@ namespace chrome { |
struct FaviconImageResult; |
} |
+class JumpListFactory; |
class PrefChangeRegistrar; |
class Profile; |
@@ -53,10 +55,9 @@ class Profile; |
// Note. base::CancelableTaskTracker is not thread safe, so we |
// always delete JumpList on UI thread (the same thread it got constructed on). |
class JumpList : public sessions::TabRestoreServiceObserver, |
- public content::NotificationObserver, |
public history::TopSitesObserver, |
- public base::NonThreadSafe, |
- public base::RefCounted<JumpList> { |
+ public RefcountedKeyedService, |
+ public base::NonThreadSafe { |
public: |
struct JumpListData { |
JumpListData(); |
@@ -80,13 +81,6 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
ShellLinkItemList recently_closed_pages_; |
}; |
- explicit JumpList(Profile* profile); |
- |
- // NotificationObserver implementation. |
- void Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) override; |
- |
// Observer callback for TabRestoreService::Observer to notify when a tab is |
// added or removed. |
void TabRestoreServiceChanged(sessions::TabRestoreService* service) override; |
@@ -104,12 +98,16 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
// is destroyed. |
void Terminate(); |
+ // RefcountedKeyedService: |
+ void ShutdownOnUIThread() override; |
+ |
// Returns true if the custom JumpList is enabled. |
// The custom jumplist works only on Windows 7 and above. |
static bool Enabled(); |
private: |
- friend class base::RefCounted<JumpList>; |
+ friend JumpListFactory; |
+ explicit JumpList(Profile* profile); // Use JumpListFactory instead |
~JumpList() override; |
// Creates a ShellLinkItem object from a tab (or a window) and add it to the |
@@ -165,7 +163,6 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
Profile* profile_; |
// Lives on the UI thread. |
- std::unique_ptr<content::NotificationRegistrar> registrar_; |
std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
// App id to associate with the jump list. |