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

Unified Diff: chrome/browser/win/jumplist.h

Issue 2323603002: Convert JumpList to a KeyedService. (Closed)
Patch Set: Clang fixes Created 4 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 | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698