#include "base/prefs/pref_member.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 "ui/base/window_open_disposition.h"
class Browser;
class BrowserWindow;
class Profile;
-class ProfileManager;
namespace content {
struct NativeWebKeyboardEvent;
namespace chrome {
class BrowserCommandController : public CommandUpdaterDelegate,
- public ProfileInfoCacheObserver,
public TabStripModelObserver,
public TabRestoreServiceObserver {
public:
- BrowserCommandController(Browser* browser, ProfileManager* profile_manager);
- virtual ~BrowserCommandController();
+ explicit BrowserCommandController(Browser* browser);
+ ~BrowserCommandController() override;
CommandUpdater* command_updater() { return &command_updater_; }
bool block_command_execution() const { return block_command_execution_; }
// Notifies the controller that state has changed in one of the following
// areas and it should update command states.
void TabStateChanged();
+ void ZoomStateChanged();
void ContentRestrictionsChanged();
void FullscreenStateChanged();
void PrintingStateChanged();
class InterstitialObserver;
// Overridden from CommandUpdaterDelegate:
- virtual void ExecuteCommandWithDisposition(
- int id,
- WindowOpenDisposition disposition) OVERRIDE;
-
- // Overridden from ProfileInfoCacheObserver:
- virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
- virtual void OnProfileWasRemoved(const base::FilePath& profile_path,
- const base::string16& profile_name) OVERRIDE;
+ void ExecuteCommandWithDisposition(int id, WindowOpenDisposition disposition)
+ override;
// Overridden from TabStripModelObserver:
- virtual void TabInsertedAt(content::WebContents* contents,
- int index,
- bool foreground) OVERRIDE;
- virtual void TabDetachedAt(content::WebContents* contents,
- int index) OVERRIDE;
- virtual void TabReplacedAt(TabStripModel* tab_strip_model,
- content::WebContents* old_contents,
- content::WebContents* new_contents,
- int index) OVERRIDE;
- virtual void TabBlockedStateChanged(content::WebContents* contents,
- int index) OVERRIDE;
+ void TabInsertedAt(content::WebContents* contents,
+ int index,
+ bool foreground) override;
+ void TabDetachedAt(content::WebContents* contents, int index) override;
+ void TabReplacedAt(TabStripModel* tab_strip_model,
+ content::WebContents* old_contents,
+ content::WebContents* new_contents,
+ int index) override;
+ void TabBlockedStateChanged(content::WebContents* contents,
+ int index) override;
// Overridden from TabRestoreServiceObserver:
- virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE;
- virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE;
+ void TabRestoreServiceChanged(TabRestoreService* service) override;
+ void TabRestoreServiceDestroyed(TabRestoreService* service) override;
+ void TabRestoreServiceLoaded(TabRestoreService* service) 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
// Update commands whose state depends on the tab's state.
void UpdateCommandsForTabState();
+ // Update Zoom commands based on zoom state.
+ void UpdateCommandsForZoomState();
+
// Updates commands when the content's restrictions change.
void UpdateCommandsForContentRestrictionState();
// window is in.
void UpdateCommandsForFullscreenMode();
- // Update commands whose state depends on whether multiple profiles are
- // allowed.
- void UpdateCommandsForMultipleProfiles();
-
// Updates the printing command state.
void UpdatePrintingState();
// Updates commands for find.
void UpdateCommandsForFind();
+ void UpdateTabRestoreCommandState();
+
// Add/remove observers for interstitial attachment/detachment from
// |contents|.
void AddInterstitialObservers(content::WebContents* contents);
Browser* browser_;
- ProfileManager* profile_manager_;
-
// The CommandUpdater that manages the browser window commands.
CommandUpdater command_updater_;