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

Unified Diff: views/view.h

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: is_visible_ changes 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/view.h
diff --git a/views/view.h b/views/view.h
index 25b6e0f34d7d21390ded808f9f7c471f35cc3ccd..957e195c307bcf4cfe279316b48a37a5fabd0527 100644
--- a/views/view.h
+++ b/views/view.h
@@ -305,7 +305,7 @@ class View : public AcceleratorTarget {
virtual int GetHeightForWidth(int w);
// Set whether the receiving view is visible. Painting is scheduled as needed
- virtual void SetVisible(bool flag);
+ virtual void SetVisible(bool visible);
// Return whether a view is visible
virtual bool IsVisible() const;
@@ -317,7 +317,7 @@ class View : public AcceleratorTarget {
// Set whether this view is enabled. A disabled view does not receive keyboard
// or mouse inputs. If flag differs from the current value, SchedulePaint is
// invoked.
- virtual void SetEnabled(bool flag);
+ void SetEnabled(bool enabled);
// Returns whether the view is enabled.
virtual bool IsEnabled() const;
@@ -938,9 +938,9 @@ class View : public AcceleratorTarget {
// its ancestors. This is used for clipping NativeViewHost.
virtual void OnVisibleBoundsChanged();
- // TODO(beng): eliminate in protected.
- // Whether this view is enabled.
- bool enabled_;
+ // Override to be notified when the enabled state of this View has
+ // changed. The default implementation calls SchedulePaint() on this View.
+ virtual void OnEnabledChanged();
// Tree operations -----------------------------------------------------------
@@ -1321,9 +1321,12 @@ class View : public AcceleratorTarget {
// This View's bounds in the parent coordinate system.
gfx::Rect bounds_;
- // Visible state
+ // Whether this view is visible.
bool is_visible_;
+ // Whether this view is enabled.
+ bool enabled_;
+
// Whether or not RegisterViewForVisibleBoundsNotification on the RootView
// has been invoked.
bool registered_for_visible_bounds_notification_;

Powered by Google App Engine
This is Rietveld 408576698