Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / browser_command_controller.h
index da9e995..f9965b7 100644 (file)
@@ -11,7 +11,6 @@
 #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"
@@ -19,7 +18,6 @@
 class Browser;
 class BrowserWindow;
 class Profile;
-class ProfileManager;
 
 namespace content {
 struct NativeWebKeyboardEvent;
@@ -28,12 +26,11 @@ 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_; }
@@ -59,6 +56,7 @@ class BrowserCommandController : public CommandUpdaterDelegate,
   // 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();
@@ -80,31 +78,25 @@ class BrowserCommandController : public CommandUpdaterDelegate,
   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
@@ -121,6 +113,9 @@ class BrowserCommandController : public CommandUpdaterDelegate,
   // 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();
 
@@ -141,10 +136,6 @@ class BrowserCommandController : public CommandUpdaterDelegate,
   // 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();
 
@@ -165,6 +156,8 @@ class BrowserCommandController : public CommandUpdaterDelegate,
   // Updates commands for find.
   void UpdateCommandsForFind();
 
+  void UpdateTabRestoreCommandState();
+
   // Add/remove observers for interstitial attachment/detachment from
   // |contents|.
   void AddInterstitialObservers(content::WebContents* contents);
@@ -175,8 +168,6 @@ class BrowserCommandController : public CommandUpdaterDelegate,
 
   Browser* browser_;
 
-  ProfileManager* profile_manager_;
-
   // The CommandUpdater that manages the browser window commands.
   CommandUpdater command_updater_;