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

Unified Diff: views/controls/label.cc

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DisableOnHover test? Created 9 years, 7 months 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 | « views/controls/label.h ('k') | views/controls/link.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/label.cc
diff --git a/views/controls/label.cc b/views/controls/label.cc
index 627dd98bab7b7be0f2300e4bc769e1b69cb95ab1..dc5c4de4bf34531826bc97d43bdccb345cda4c49 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -206,11 +206,9 @@ int Label::GetHeightForWidth(int w) {
return h + GetInsets().height();
}
-void Label::SetEnabled(bool enabled) {
- if (enabled == enabled_)
- return;
- View::SetEnabled(enabled);
- SetColor(enabled ? kEnabledColor : kDisabledColor);
+void Label::OnEnabledChanged() {
+ View::OnEnabledChanged();
+ SetColor(IsEnabled() ? kEnabledColor : kDisabledColor);
}
std::string Label::GetClassName() const {
« no previous file with comments | « views/controls/label.h ('k') | views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698