diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/view.cc | 6 | ||||
-rw-r--r-- | views/view.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/views/view.cc b/views/view.cc index c04a4df7..437b3b7 100644 --- a/views/view.cc +++ b/views/view.cc @@ -556,6 +556,12 @@ int View::GetChildViewCount() const { return static_cast<int>(child_views_.size()); } +bool View::HasChildView(View* a_view) { + return find(child_views_.begin(), + child_views_.end(), + a_view) != child_views_.end(); +} + void View::RemoveChildView(View* a_view) { DoRemoveChildView(a_view, true, true, false); } diff --git a/views/view.h b/views/view.h index d493a0b..0dcc734 100644 --- a/views/view.h +++ b/views/view.h @@ -435,6 +435,9 @@ class View : public AcceleratorTarget { // Get the number of child Views. int GetChildViewCount() const; + // Tests if this view has a given view as direct child. + bool HasChildView(View* a_view); + // Returns the deepest descendant that contains the specified point. virtual View* GetViewForPoint(const gfx::Point& point); |