diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 22:16:46 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 22:16:46 +0000 |
commit | 55857475658834a2aff1a896cd56d970cf20fab4 (patch) | |
tree | 455943149b84cf90abfed91582b213ff5fdac814 /views/controls/button | |
parent | 04fc948392b6fba1e640bd97eeea2293d9ed9b7e (diff) | |
download | chromium_src-55857475658834a2aff1a896cd56d970cf20fab4.zip chromium_src-55857475658834a2aff1a896cd56d970cf20fab4.tar.gz chromium_src-55857475658834a2aff1a896cd56d970cf20fab4.tar.bz2 |
Fix Chexkbox::SetLabel on windows, which uses view's label instead of
native one.
Review URL: http://codereview.chromium.org/208018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button')
-rw-r--r-- | views/controls/button/checkbox.cc | 6 | ||||
-rw-r--r-- | views/controls/button/checkbox.h | 3 | ||||
-rw-r--r-- | views/controls/button/native_button.h | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index c45bd52..9120ace 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -165,6 +165,12 @@ void Checkbox::InitBorder() { // No border, so we do nothing. } +void Checkbox::SetLabel(const std::wstring& label) { + NativeButton::SetLabel(label); + if (!native_wrapper_->UsesNativeLabel()) + label_->SetText(label); +} + //////////////////////////////////////////////////////////////////////////////// // Checkbox, protected: diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index bae6bde..e138885 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -54,6 +54,9 @@ class Checkbox : public NativeButton { virtual void WillGainFocus(); virtual void WillLoseFocus(); + // Overridden from NativeButton: + virtual void SetLabel(const std::wstring& label); + protected: virtual std::string GetClassName() const; diff --git a/views/controls/button/native_button.h b/views/controls/button/native_button.h index 22dc60a..428d0ad 100644 --- a/views/controls/button/native_button.h +++ b/views/controls/button/native_button.h @@ -25,7 +25,7 @@ class NativeButton : public Button { virtual ~NativeButton(); // Sets/Gets the text to be used as the button's label. - void SetLabel(const std::wstring& label); + virtual void SetLabel(const std::wstring& label); std::wstring label() const { return label_; } // Sets the font to be used when displaying the button's label. |