Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 7eb75ef95e9fe66eebf27b43c6fa22a9fe7fce5a..d46ad121dd4c99b273a618a23bad1fc459e54470 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -94,19 +94,15 @@ bool CustomButton::IsHotTracked() const {
}
void CustomButton::OnEnabledChanged() {
- if (View::IsEnabled() ? (state_ != BS_DISABLED) : (state_ == BS_DISABLED))
+ if (enabled() ? (state_ != BS_DISABLED) : (state_ == BS_DISABLED))
return;
- if (View::IsEnabled())
+ if (enabled())
SetState(IsMouseHovered() ? BS_HOT : BS_NORMAL);
else
SetState(BS_DISABLED);
}
-bool CustomButton::IsEnabled() const {
- return state_ != BS_DISABLED;
-}
-
std::string CustomButton::GetClassName() const {
return kViewClassName;
}
@@ -198,7 +194,7 @@ bool CustomButton::OnKeyReleased(const KeyEvent& event) {
}
bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
- if (!View::IsEnabled())
+ if (!enabled())
return false;
SetState(BS_NORMAL);
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698