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

Unified Diff: views/controls/single_split_view.cc

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/controls/scroll_view.cc ('k') | views/controls/single_split_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/single_split_view.cc
===================================================================
--- views/controls/single_split_view.cc (revision 92600)
+++ views/controls/single_split_view.cc (working copy)
@@ -49,11 +49,11 @@
CalculateChildrenBounds(bounds(), &leading_bounds, &trailing_bounds);
if (has_children()) {
- if (GetChildViewAt(0)->IsVisible())
- GetChildViewAt(0)->SetBoundsRect(leading_bounds);
+ if (child_at(0)->IsVisible())
+ child_at(0)->SetBoundsRect(leading_bounds);
if (child_count() > 1) {
- if (GetChildViewAt(1)->IsVisible())
- GetChildViewAt(1)->SetBoundsRect(trailing_bounds);
+ if (child_at(1)->IsVisible())
+ child_at(1)->SetBoundsRect(trailing_bounds);
}
}
@@ -76,7 +76,7 @@
int width = 0;
int height = 0;
for (int i = 0; i < 2 && i < child_count(); ++i) {
- View* view = GetChildViewAt(i);
+ View* view = child_at(i);
gfx::Size pref = view->GetPreferredSize();
if (is_horizontal_) {
width += pref.width();
@@ -110,9 +110,8 @@
const gfx::Rect& bounds,
gfx::Rect* leading_bounds,
gfx::Rect* trailing_bounds) const {
- bool is_leading_visible = has_children() && GetChildViewAt(0)->IsVisible();
- bool is_trailing_visible =
- child_count() > 1 && GetChildViewAt(1)->IsVisible();
+ bool is_leading_visible = has_children() && child_at(0)->IsVisible();
+ bool is_trailing_visible = child_count() > 1 && child_at(1)->IsVisible();
if (!is_leading_visible && !is_trailing_visible) {
*leading_bounds = gfx::Rect();
@@ -171,7 +170,7 @@
if (is_horizontal_ && base::i18n::IsRTL())
delta_offset *= -1;
// Honor the minimum size when resizing.
- gfx::Size min = GetChildViewAt(0)->GetMinimumSize();
+ gfx::Size min = child_at(0)->GetMinimumSize();
int new_size = std::max(GetPrimaryAxisSize(min.width(), min.height()),
drag_info_.initial_divider_offset + delta_offset);
@@ -206,15 +205,15 @@
if (child_count() < 2)
return false;
- if (!GetChildViewAt(0)->IsVisible() || !GetChildViewAt(1)->IsVisible())
+ if (!child_at(0)->IsVisible() || !child_at(1)->IsVisible())
return false;
int divider_relative_offset;
if (is_horizontal_) {
divider_relative_offset =
- p.x() - GetChildViewAt(base::i18n::IsRTL() ? 1 : 0)->width();
+ p.x() - child_at(base::i18n::IsRTL() ? 1 : 0)->width();
} else {
- divider_relative_offset = p.y() - GetChildViewAt(0)->height();
+ divider_relative_offset = p.y() - child_at(0)->height();
}
return (divider_relative_offset >= 0 &&
divider_relative_offset < kDividerSize);
« no previous file with comments | « views/controls/scroll_view.cc ('k') | views/controls/single_split_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698