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

Unified Diff: views/controls/single_split_view.cc

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 74231)
+++ views/controls/single_split_view.cc (working copy)
@@ -39,7 +39,8 @@
}
void SingleSplitView::OnBoundsChanged() {
- divider_offset_ = CalculateDividerOffset(divider_offset_, previous_bounds_, bounds());
+ divider_offset_ = CalculateDividerOffset(divider_offset_, previous_bounds_,
+ bounds());
View::OnBoundsChanged();
previous_bounds_ = bounds();
}
@@ -49,10 +50,10 @@
gfx::Rect trailing_bounds;
CalculateChildrenBounds(bounds(), &leading_bounds, &trailing_bounds);
- if (GetChildViewCount() > 0) {
+ if (has_children()) {
if (GetChildViewAt(0)->IsVisible())
GetChildViewAt(0)->SetBoundsRect(leading_bounds);
- if (GetChildViewCount() > 1) {
+ if (child_count() > 1) {
if (GetChildViewAt(1)->IsVisible())
GetChildViewAt(1)->SetBoundsRect(trailing_bounds);
}
@@ -71,7 +72,7 @@
gfx::Size SingleSplitView::GetPreferredSize() {
int width = 0;
int height = 0;
- for (int i = 0; i < 2 && i < GetChildViewCount(); ++i) {
+ for (int i = 0; i < 2 && i < child_count(); ++i) {
View* view = GetChildViewAt(i);
gfx::Size pref = view->GetPreferredSize();
if (is_horizontal_) {
@@ -110,10 +111,9 @@
const gfx::Rect& bounds,
gfx::Rect* leading_bounds,
gfx::Rect* trailing_bounds) const {
- bool is_leading_visible =
- GetChildViewCount() > 0 && GetChildViewAt(0)->IsVisible();
+ bool is_leading_visible = has_children() && GetChildViewAt(0)->IsVisible();
bool is_trailing_visible =
- GetChildViewCount() > 1 && GetChildViewAt(1)->IsVisible();
+ child_count() > 1 && GetChildViewAt(1)->IsVisible();
if (!is_leading_visible && !is_trailing_visible) {
*leading_bounds = gfx::Rect();
@@ -160,7 +160,7 @@
}
bool SingleSplitView::OnMouseDragged(const MouseEvent& event) {
- if (GetChildViewCount() < 2)
+ if (child_count() < 2)
return false;
int delta_offset = GetPrimaryAxisSize(event.x(), event.y()) -
@@ -184,7 +184,7 @@
}
void SingleSplitView::OnMouseReleased(const MouseEvent& event, bool canceled) {
- if (GetChildViewCount() < 2)
+ if (child_count() < 2)
return;
if (canceled && drag_info_.initial_divider_offset != divider_offset_) {
@@ -195,7 +195,7 @@
}
bool SingleSplitView::IsPointInDivider(const gfx::Point& p) {
- if (GetChildViewCount() < 2)
+ if (child_count() < 2)
return false;
if (!GetChildViewAt(0)->IsVisible() || !GetChildViewAt(1)->IsVisible())
« 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