diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 23:25:13 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 23:25:13 +0000 |
commit | 48c8fa63122510b2c51c6608a93b30e94192e679 (patch) | |
tree | dc22b80b2f4103d865cbfe47c6f4dc52c8595985 /chrome/browser/views/go_button.h | |
parent | 9ea0ea99d3a1140a17712a286414d387eddbe8ac (diff) | |
download | chromium_src-48c8fa63122510b2c51c6608a93b30e94192e679.zip chromium_src-48c8fa63122510b2c51c6608a93b30e94192e679.tar.gz chromium_src-48c8fa63122510b2c51c6608a93b30e94192e679.tar.bz2 |
Rework the Button API to be saner in preparation for NativeControl rejiggering.BaseButton->Button, CustomButtonButton->ImageButtonToggleButton->ToggleImageButtonRemoving SetListener (buttons take listener through ctor)Tidy up source files. No functionality changes, just naming and organization.Look at the button classes first, then everything else.
Review URL: http://codereview.chromium.org/46096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/go_button.h')
-rw-r--r-- | chrome/browser/views/go_button.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/views/go_button.h b/chrome/browser/views/go_button.h index 372bff5..306ae59 100644 --- a/chrome/browser/views/go_button.h +++ b/chrome/browser/views/go_button.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_VIEWS_GO_BUTTON_H__ #define CHROME_BROWSER_VIEWS_GO_BUTTON_H__ -#include "chrome/views/button.h" +#include "chrome/views/image_button.h" #include "base/task.h" class CommandUpdater; @@ -19,11 +19,12 @@ class LocationBarView; // according to the content of the location bar and changes to a stop // button when a page load is in progress. Trickiness comes from the // desire to have the 'stop' button not change back to 'go' if the user's -// mouse is hovering over it (to prevent misclicks). +// mouse is hovering over it (to prevent mis-clicks). // //////////////////////////////////////////////////////////////////////////////// -class GoButton : public views::ToggleButton { +class GoButton : public views::ToggleImageButton, + public views::ButtonListener { public: // TODO(beng): get rid of the command updater param and instead have a // delegate. @@ -32,9 +33,6 @@ class GoButton : public views::ToggleButton { typedef enum Mode { MODE_GO = 0, MODE_STOP }; - virtual void NotifyClick(int mouse_event_flags); - virtual void OnMouseExited(const views::MouseEvent& e); - // Force the button state void ChangeMode(Mode mode); @@ -42,6 +40,11 @@ class GoButton : public views::ToggleButton { // when page load state changes. void ScheduleChangeMode(Mode mode); + // Overridden from views::ButtonListener: + virtual void ButtonPressed(views::Button* button); + + // Overridden from views::View: + virtual void OnMouseExited(const views::MouseEvent& e); virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); private: @@ -52,7 +55,6 @@ class GoButton : public views::ToggleButton { LocationBarView* location_bar_; CommandUpdater* command_updater_; - ButtonListener* listener_; // The mode we should be in Mode intended_mode_; |