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

Unified Diff: chrome/browser/jumplist_win.h

Issue 660813002: [Win] Add a fast profile switcher to the Windows taskbar item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: commas. commas are important Created 6 years, 1 month 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/chromeos/profiles/avatar_menu_chromeos.cc ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/jumplist_win.h
diff --git a/chrome/browser/jumplist_win.h b/chrome/browser/jumplist_win.h
index 854ab6b6b4c3fbb872ec3d8dd2663016ae76a2ad..0f9a7fb8c8545dd67d5bd71ec0d1ccc8431f45b4 100644
--- a/chrome/browser/jumplist_win.h
+++ b/chrome/browser/jumplist_win.h
@@ -17,6 +17,8 @@
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/jumplist_updater_win.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
+#include "chrome/browser/profiles/avatar_menu.h"
+#include "chrome/browser/profiles/avatar_menu_observer.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_observer.h"
#include "components/history/core/browser/history_types.h"
@@ -53,23 +55,27 @@ class Profile;
// always delete JumpList on UI thread (the same thread it got constructed on).
class JumpList : public TabRestoreServiceObserver,
public content::NotificationObserver,
+ public AvatarMenuObserver,
public base::RefCountedThreadSafe<
JumpList, content::BrowserThread::DeleteOnUIThread> {
public:
explicit JumpList(Profile* profile);
// NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details);
+ 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.
- virtual void TabRestoreServiceChanged(TabRestoreService* service);
+ void TabRestoreServiceChanged(TabRestoreService* service) override;
// Observer callback to notice when our associated TabRestoreService
// is destroyed.
- virtual void TabRestoreServiceDestroyed(TabRestoreService* service);
+ void TabRestoreServiceDestroyed(TabRestoreService* service) override;
+
+ // Overridden from AvatarMenuObserver:
+ void OnAvatarMenuChanged(AvatarMenu* avatar_menu) override;
// Cancel a pending jumplist update.
void CancelPendingUpdate();
@@ -128,12 +134,17 @@ class JumpList : public TabRestoreServiceObserver,
// Runnable method that updates the jumplist, once all the data
// has been fetched.
- void RunUpdate(IncognitoModePrefs::Availability incognito_availability);
+ void RunUpdateOnFileThread(
+ IncognitoModePrefs::Availability incognito_availability);
// Helper method for RunUpdate to create icon files for the asynchrounously
// loaded icons.
void CreateIconFiles(const ShellLinkItemList& item_list);
+ // Called when the list of Profiles has changed. This function updates the
+ // |profile_switcher_| ShellLinkItemList.
+ void UpdateProfileSwitcher();
+
// Tracks FaviconService tasks.
base::CancelableTaskTracker cancelable_task_tracker_;
@@ -158,6 +169,10 @@ class JumpList : public TabRestoreServiceObserver,
// protected by the list_lock_.
ShellLinkItemList recently_closed_pages_;
+ // Items in the "People" category of the application JumpList, protected
+ // by the list_lock_.
+ ShellLinkItemList profile_switcher_;
+
// A list of URLs we need to retrieve their favicons,
// protected by the list_lock_.
typedef std::pair<std::string, scoped_refptr<ShellLinkItem> > URLPair;
@@ -174,6 +189,13 @@ class JumpList : public TabRestoreServiceObserver,
// For callbacks may be run after destruction.
base::WeakPtrFactory<JumpList> weak_ptr_factory_;
+ // Contains data about existing Profiles.
+ scoped_ptr<AvatarMenu> avatar_menu_;
+
+ // Whether the experiment that is replacing "Most Visited" category with a
+ // "People" category is enabled.
+ bool use_profiles_category_;
+
DISALLOW_COPY_AND_ASSIGN(JumpList);
};
« no previous file with comments | « chrome/browser/chromeos/profiles/avatar_menu_chromeos.cc ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698