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

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 win, move OnEnabledChanged to protected section, add comment 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
Index: views/controls/label.cc
diff --git a/views/controls/label.cc b/views/controls/label.cc
index 627dd98bab7b7be0f2300e4bc769e1b69cb95ab1..62e2060cf43eda2b098a1612c73ce4f8ca2557a7 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(View::IsEnabled() ? kEnabledColor : kDisabledColor);
}
std::string Label::GetClassName() const {
« no previous file with comments | « views/controls/label.h ('k') | views/controls/link.h » ('j') | views/controls/native_control.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698