From bcd6cf7b2d813be66486a4b71345deb4050453c1 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Fri, 3 Jun 2011 18:36:47 +0000 Subject: views: Use ViewVector typedef instead of std::vector in view.* BUG=72040,68682 TEST=None R=sky@chromium.org Review URL: http://codereview.chromium.org/7111008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87823 0039d316-1c4b-4281-b951-d872f2087c98 --- views/view.cc | 8 ++++---- views/view.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/views/view.cc b/views/view.cc index 2c36cc7..039c70c 100644 --- a/views/view.cc +++ b/views/view.cc @@ -566,7 +566,7 @@ bool View::IsGroupFocusTraversable() const { return true; } -void View::GetViewsWithGroup(int group_id, std::vector* out) { +void View::GetViewsWithGroup(int group_id, ViewVector* out) { if (group_ == group_id) out->push_back(this); @@ -575,7 +575,7 @@ void View::GetViewsWithGroup(int group_id, std::vector* out) { } View* View::GetSelectedViewForGroup(int group_id) { - std::vector views; + ViewVector views; GetWidget()->GetRootView()->GetViewsWithGroup(group_id, &views); return views.empty() ? NULL : views[0]; } @@ -1463,7 +1463,7 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) { // Notify interested Views that visible bounds within the root view may have // changed. if (descendants_to_notify_.get()) { - for (std::vector::iterator i = descendants_to_notify_->begin(); + for (ViewVector::iterator i = descendants_to_notify_->begin(); i != descendants_to_notify_->end(); ++i) { (*i)->OnVisibleBoundsChanged(); } @@ -1744,7 +1744,7 @@ void View::InitFocusSiblings(View* v, int index) { // the last focusable element. Let's try to find an element with no next // focusable element to link to. View* last_focusable_view = NULL; - for (std::vector::iterator iter = children_.begin(); + for (ViewVector::iterator iter = children_.begin(); iter != children_.end(); ++iter) { if (!(*iter)->next_focusable_view_) { last_focusable_view = *iter; diff --git a/views/view.h b/views/view.h index 27aed3a..d60fa43 100644 --- a/views/view.h +++ b/views/view.h @@ -143,6 +143,8 @@ class DragController { ///////////////////////////////////////////////////////////////////////////// class View : public AcceleratorTarget { public: + typedef std::vector ViewVector; + #if defined(TOUCH_UI) enum TouchStatus { TOUCH_STATUS_UNKNOWN = 0, // Unknown touch status. This is used to indicate @@ -450,7 +452,7 @@ class View : public AcceleratorTarget { // Fills the provided vector with all the available views which belong to the // provided group. - void GetViewsWithGroup(int group_id, std::vector* out); + void GetViewsWithGroup(int group_id, ViewVector* out); // Return the View that is currently selected in the specified group. // The default implementation simply returns the first View found for that @@ -1314,7 +1316,6 @@ class View : public AcceleratorTarget { View* parent_; // This view's children. - typedef std::vector ViewVector; ViewVector children_; // Size and disposition ------------------------------------------------------ -- cgit v1.1