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

Unified Diff: views/view.h

Issue 7349021: Convert some more view methods to the ui/views style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/layout/grid_layout_unittest.cc ('k') | views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.h
===================================================================
--- views/view.h (revision 92600)
+++ views/view.h (working copy)
@@ -13,6 +13,7 @@
#include <vector>
#include "base/i18n/rtl.h"
+#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "ui/base/dragdrop/os_exchange_data.h"
@@ -136,13 +137,20 @@
// the views are deleted, unless marked as not parent owned.
void RemoveAllChildViews(bool delete_children);
- // Returns the child view at |index|.
- const View* GetChildViewAt(int index) const;
- View* GetChildViewAt(int index);
-
- // Returns the number of child views.
+ // STL-style accessors.
+ Views::const_iterator children_begin() { return children_.begin(); }
+ Views::const_iterator children_end() { return children_.end(); }
+ Views::const_reverse_iterator children_rbegin() { return children_.rbegin(); }
+ Views::const_reverse_iterator children_rend() { return children_.rend(); }
int child_count() const { return static_cast<int>(children_.size()); }
bool has_children() const { return !children_.empty(); }
+ View* child_at(int index) {
+ DCHECK_LT(index, child_count());
+ return children_[index];
+ }
+ const View* child_at(int index) const {
+ return const_cast<View*>(const_cast<const View*>(this))->child_at(index);
+ }
// Returns the parent view.
const View* parent() const { return parent_; }
« no previous file with comments | « views/layout/grid_layout_unittest.cc ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698