diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 23:03:14 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 23:03:14 +0000 |
commit | 1fc025209fbaeb2eb91cfeac8dbced8bc493f3b2 (patch) | |
tree | 13faf73a68138e0cd30e7b628a677ebb0422aa8c /chrome/browser/views/toolbar_view.h | |
parent | 91f57782b0dd7a847b8d31020003f00099366545 (diff) | |
download | chromium_src-1fc025209fbaeb2eb91cfeac8dbced8bc493f3b2.zip chromium_src-1fc025209fbaeb2eb91cfeac8dbced8bc493f3b2.tar.gz chromium_src-1fc025209fbaeb2eb91cfeac8dbced8bc493f3b2.tar.bz2 |
Rework the command updater to not be dependent on views::Button (needed for porting).
TEST=make sure back/forward buttons still enable/disable correctly depending on the length of the back/forward navigation list.
Review URL: http://codereview.chromium.org/18343
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/toolbar_view.h')
-rw-r--r-- | chrome/browser/views/toolbar_view.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index a927f0c..a4b6ec0 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -10,7 +10,7 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "chrome/browser/back_forward_menu_model.h" -#include "chrome/browser/controller.h" +#include "chrome/browser/command_updater.h" #include "chrome/browser/encoding_menu_controller_delegate.h" #include "chrome/browser/user_data_manager.h" #include "chrome/browser/views/dom_view.h" @@ -40,9 +40,11 @@ class BrowserToolbarView : public views::View, public views::DragController, public LocationBarView::Delegate, public NotificationObserver, - public GetProfilesHelper::Delegate { + public GetProfilesHelper::Delegate, + public CommandUpdater::CommandObserver, + public views::BaseButton::ButtonListener { public: - BrowserToolbarView(CommandController* controller, Browser* browser); + explicit BrowserToolbarView(Browser* browser); virtual ~BrowserToolbarView(); // Create the contents of the Browser Toolbar @@ -116,6 +118,12 @@ class BrowserToolbarView : public views::View, Browser* browser() { return browser_; } + // Overridden from CommandUpdater::CommandObserver: + virtual void EnabledStateChangedForCommand(int id, bool enabled); + + // Overridden from views::BaseButton::ButtonListener: + virtual void ButtonPressed(views::BaseButton* sender); + private: // NotificationObserver virtual void Observe(NotificationType type, @@ -159,9 +167,6 @@ class BrowserToolbarView : public views::View, return display_mode_ == DISPLAYMODE_NORMAL; } - // This View's Command Controller - CommandController* controller_; - scoped_ptr<BackForwardMenuModel> back_menu_model_; scoped_ptr<BackForwardMenuModel> forward_menu_model_; |