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

Unified Diff: views/controls/scroll_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/native_control_win.cc ('k') | views/controls/single_split_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/scroll_view.cc
===================================================================
--- views/controls/scroll_view.cc (revision 74231)
+++ views/controls/scroll_view.cc (working copy)
@@ -19,13 +19,13 @@
virtual ~Viewport() {}
virtual void ScrollRectToVisible(const gfx::Rect& rect) {
- if (!GetChildViewCount() || !GetParent())
+ if (!has_children() || !parent())
return;
View* contents = GetChildViewAt(0);
gfx::Rect scroll_rect(rect);
scroll_rect.Offset(-contents->x(), -contents->y());
- static_cast<ScrollView*>(GetParent())->ScrollContentsRegionToBeVisible(
+ static_cast<ScrollView*>(parent())->ScrollContentsRegionToBeVisible(
scroll_rect);
}
@@ -46,17 +46,14 @@
ScrollView::~ScrollView() {
// If scrollbars are currently not used, delete them
- if (!horiz_sb_->GetParent()) {
+ if (!horiz_sb_->parent())
delete horiz_sb_;
- }
- if (!vert_sb_->GetParent()) {
+ if (!vert_sb_->parent())
delete vert_sb_;
- }
- if (resize_corner_ && !resize_corner_->GetParent()) {
+ if (resize_corner_ && !resize_corner_->parent())
delete resize_corner_;
- }
}
void ScrollView::SetContents(View* a_view) {
@@ -449,7 +446,7 @@
return 0;
// y coordinate is most likely negative.
int y = abs(scroll_view->GetContents()->y());
- int vis_height = scroll_view->GetContents()->GetParent()->height();
+ int vis_height = scroll_view->GetContents()->parent()->height();
if (is_positive) {
// Align the bottom most row to the top of the view.
int bottom = std::min(scroll_view->GetContents()->height() - 1,
« no previous file with comments | « views/controls/native_control_win.cc ('k') | views/controls/single_split_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698