summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 18:31:14 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 18:31:14 +0000
commit822809e5b5b4eddbc532b083fcaad848f255f3ef (patch)
tree8208ddc8e91ff40d56c7bbad806776355aa65f75 /views
parent6c4d215ecd29ac00a618fdff5477c0184ccf1b6c (diff)
downloadchromium_src-822809e5b5b4eddbc532b083fcaad848f255f3ef.zip
chromium_src-822809e5b5b4eddbc532b083fcaad848f255f3ef.tar.gz
chromium_src-822809e5b5b4eddbc532b083fcaad848f255f3ef.tar.bz2
Cleanup: Remove SetAppearsAsDefault() since it is no longer called externally. Inline its functionality into the lone internal caller.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6133011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/native_button.cc14
-rw-r--r--views/controls/button/native_button.h5
2 files changed, 5 insertions, 14 deletions
diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc
index 650bf0f..71a6b5a4 100644
--- a/views/controls/button/native_button.cc
+++ b/views/controls/button/native_button.cc
@@ -87,11 +87,14 @@ void NativeButton::SetLabel(const std::wstring& label) {
void NativeButton::SetIsDefault(bool is_default) {
if (is_default == is_default_)
return;
- if (is_default)
+ is_default_ = is_default;
+ if (is_default_)
AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false));
else
RemoveAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false));
- SetAppearsAsDefault(is_default);
+ if (native_wrapper_)
+ native_wrapper_->UpdateDefault();
+ PreferredSizeChanged();
}
void NativeButton::SetNeedElevation(bool need_elevation) {
@@ -101,13 +104,6 @@ void NativeButton::SetNeedElevation(bool need_elevation) {
PreferredSizeChanged();
}
-void NativeButton::SetAppearsAsDefault(bool appears_as_default) {
- is_default_ = appears_as_default;
- if (native_wrapper_)
- native_wrapper_->UpdateDefault();
- PreferredSizeChanged();
-}
-
void NativeButton::ButtonPressed() {
RequestFocus();
diff --git a/views/controls/button/native_button.h b/views/controls/button/native_button.h
index 86a935a..4090040 100644
--- a/views/controls/button/native_button.h
+++ b/views/controls/button/native_button.h
@@ -44,11 +44,6 @@ class NativeButton : public Button {
void SetNeedElevation(bool need_elevation);
bool need_elevation() const { return need_elevation_; }
- // Sets whether or not the button appears as the default button. This does
- // not make it behave as the default (i.e. no enter key accelerator is
- // registered, use SetIsDefault for that).
- void SetAppearsAsDefault(bool default_button);
-
void set_ignore_minimum_size(bool ignore_minimum_size) {
ignore_minimum_size_ = ignore_minimum_size;
}