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

Unified Diff: views/view.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/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.cc
diff --git a/views/view.cc b/views/view.cc
index 88e3ce35047df8fba967e37f5c60ca028dd1b164..eb6bd0433e0657c5a410cd3aeb3263ae06b41379 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -95,13 +95,13 @@ Widget* View::GetChildWidget() {
// Creation and lifetime -------------------------------------------------------
View::View()
- : enabled_(true),
- focusable_(false),
+ : focusable_(false),
parent_owned_(true),
id_(0),
group_(-1),
parent_(NULL),
is_visible_(true),
+ enabled_(true),
registered_for_visible_bounds_notification_(false),
clip_x_(0.0),
clip_y_(0.0),
@@ -353,22 +353,21 @@ int View::GetHeightForWidth(int w) {
return GetPreferredSize().height();
}
-void View::SetVisible(bool flag) {
- if (flag != is_visible_) {
- // If the tab is currently visible, schedule paint to
- // refresh parent
- if (IsVisible())
+void View::SetVisible(bool visible) {
+ if (visible != is_visible_) {
+ // If the tab is currently visible, schedule paint to refresh parent.
+ if (is_visible_)
SchedulePaint();
else
ResetTexture();
- is_visible_ = flag;
+ is_visible_ = visible;
// This notifies all sub-views recursively.
- PropagateVisibilityNotifications(this, flag);
+ PropagateVisibilityNotifications(this, is_visible_);
// If we are newly visible, schedule paint.
- if (IsVisible())
+ if (is_visible_)
SchedulePaint();
}
}
@@ -381,10 +380,10 @@ bool View::IsVisibleInRootView() const {
return IsVisible() && parent() ? parent()->IsVisibleInRootView() : false;
}
-void View::SetEnabled(bool state) {
- if (enabled_ != state) {
- enabled_ = state;
- SchedulePaint();
+void View::SetEnabled(bool enabled) {
+ if (enabled != enabled_) {
+ enabled_ = enabled;
+ OnEnabledChanged();
}
}
@@ -392,6 +391,10 @@ bool View::IsEnabled() const {
return enabled_;
}
+void View::OnEnabledChanged() {
+ SchedulePaint();
+}
+
// Transformations -------------------------------------------------------------
const ui::Transform& View::GetTransform() const {
« no previous file with comments | « views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698