diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 18:30:55 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 18:30:55 +0000 |
commit | 557c4e214cac751d83976b202e2efde89c0bf828 (patch) | |
tree | 56ac3e646cb3b7a5caec3cd1a189427bc9e18b11 /chrome/browser/ui/browser_command_controller.h | |
parent | cb6b8addebf680fb3f686e480e1000c60e27c2d2 (diff) | |
download | chromium_src-557c4e214cac751d83976b202e2efde89c0bf828.zip chromium_src-557c4e214cac751d83976b202e2efde89c0bf828.tar.gz chromium_src-557c4e214cac751d83976b202e2efde89c0bf828.tar.bz2 |
Disable profile avatar menu shortcut when there's only one profile.
BUG=108367
TEST=Shortcut doesn't launch menu when there's a single profile.
Adding/deleting profiles propertly changes the state.
Review URL: https://chromiumcodereview.appspot.com/11574010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_command_controller.h')
-rw-r--r-- | chrome/browser/ui/browser_command_controller.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/chrome/browser/ui/browser_command_controller.h b/chrome/browser/ui/browser_command_controller.h index 3f76188..31bfe7b 100644 --- a/chrome/browser/ui/browser_command_controller.h +++ b/chrome/browser/ui/browser_command_controller.h @@ -9,6 +9,7 @@ #include "chrome/browser/api/sync/profile_sync_service_observer.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/command_updater_delegate.h" +#include "chrome/browser/profiles/profile_info_cache_observer.h" #include "chrome/browser/sessions/tab_restore_service_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "content/public/browser/notification_observer.h" @@ -18,6 +19,7 @@ class Browser; class BrowserWindow; class Profile; +class ProfileManager; namespace content { struct NativeWebKeyboardEvent; @@ -27,11 +29,12 @@ namespace chrome { class BrowserCommandController : public CommandUpdaterDelegate, public content::NotificationObserver, + public ProfileInfoCacheObserver, + public ProfileSyncServiceObserver, public TabStripModelObserver, - public TabRestoreServiceObserver, - public ProfileSyncServiceObserver { + public TabRestoreServiceObserver { public: - explicit BrowserCommandController(Browser* browser); + BrowserCommandController(Browser* browser, ProfileManager* profile_manager); virtual ~BrowserCommandController(); CommandUpdater* command_updater() { return &command_updater_; } @@ -86,6 +89,18 @@ class BrowserCommandController : public CommandUpdaterDelegate, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; + // Overridden from ProfileInfoCacheObserver: + virtual void OnProfileAdded(const FilePath& profile_path) OVERRIDE; + virtual void OnProfileWillBeRemoved(const FilePath& profile_path) OVERRIDE; + virtual void OnProfileWasRemoved(const FilePath& profile_path, + const string16& profile_name) OVERRIDE; + virtual void OnProfileNameChanged(const FilePath& profile_path, + const string16& old_profile_name) OVERRIDE; + virtual void OnProfileAvatarChanged(const FilePath& profile_path) OVERRIDE; + + // Overridden from ProfileSyncServiceObserver: + virtual void OnStateChanged() OVERRIDE; + // Overridden from TabStripModelObserver: virtual void TabInsertedAt(content::WebContents* contents, int index, @@ -103,9 +118,6 @@ class BrowserCommandController : public CommandUpdaterDelegate, virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE; - // Overridden from ProfileSyncServiceObserver: - virtual void OnStateChanged() OVERRIDE; - // Returns true if the regular Chrome UI (not the fullscreen one and // not the single-tab one) is shown. Used for updating window command states // only. Consider using SupportsWindowFeature if you need the mentioned @@ -172,6 +184,8 @@ class BrowserCommandController : public CommandUpdaterDelegate, Browser* browser_; + ProfileManager* profile_manager_; + // The CommandUpdater that manages the browser window commands. CommandUpdater command_updater_; |