diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 23:59:11 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 23:59:11 +0000 |
commit | a764c5a702d31b8c87cc2cf9341da082419164c0 (patch) | |
tree | 1c2ec3f348f6db90d920aed50dbcff8063a78df6 /ash | |
parent | 831c6bc95daf7f2e3966c168ecafb340e930d390 (diff) | |
download | chromium_src-a764c5a702d31b8c87cc2cf9341da082419164c0.zip chromium_src-a764c5a702d31b8c87cc2cf9341da082419164c0.tar.gz chromium_src-a764c5a702d31b8c87cc2cf9341da082419164c0.tar.bz2 |
Cleanup of ScrollView. I'm going to add support for a header view
(needed for tables) an in starting to do this I realized the file
could use some cleanup. This patch cleans up the following:
. fixs a couple of const issues.
. inlines a handful of things (GetContents() -> contents() resulted in
a couple of external changes)
. Made a couple of methods private that should not have been public.
. Consolidated override sections.
. Made method ordering in .h/.cc match.
I also added a couple of tests for cases I wanted to make sure I'm not going to break.
I haven't made any behavior changes here.
BUG=none
TEST=none
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11528017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash.gyp | 1 | ||||
-rw-r--r-- | ash/system/tray/tray_views.cc | 16 |
2 files changed, 8 insertions, 9 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index b4d6be7..6f3d16b 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -651,6 +651,7 @@ '../ui/ui.gyp:ui', '../ui/ui.gyp:ui_resources', '../ui/views/views.gyp:views', + '../ui/views/views.gyp:views_examples_lib', '../ui/views/views.gyp:views_examples_with_content_lib', '../ui/views/views.gyp:views_test_support', 'ash', diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc index 1c66daa..8f3e2dd 100644 --- a/ash/system/tray/tray_views.cc +++ b/ash/system/tray/tray_views.cc @@ -350,31 +350,29 @@ void FixedSizedScrollView::SetFixedSize(const gfx::Size& size) { gfx::Size FixedSizedScrollView::GetPreferredSize() { gfx::Size size = fixed_size_.IsEmpty() ? - GetContents()->GetPreferredSize() : fixed_size_; + contents()->GetPreferredSize() : fixed_size_; gfx::Insets insets = GetInsets(); size.Enlarge(insets.width(), insets.height()); return size; } void FixedSizedScrollView::Layout() { - views::View* contents = GetContents(); - gfx::Rect bounds = gfx::Rect(contents->GetPreferredSize()); + gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize()); bounds.set_width(std::max(0, width() - GetScrollBarWidth())); - contents->SetBoundsRect(bounds); + contents()->SetBoundsRect(bounds); views::ScrollView::Layout(); if (!vertical_scroll_bar()->visible()) { - gfx::Rect bounds = contents->bounds(); + gfx::Rect bounds = contents()->bounds(); bounds.set_width(bounds.width() + GetScrollBarWidth()); - contents->SetBoundsRect(bounds); + contents()->SetBoundsRect(bounds); } } void FixedSizedScrollView::OnBoundsChanged(const gfx::Rect& previous_bounds) { - views::View* contents = GetContents(); - gfx::Rect bounds = gfx::Rect(contents->GetPreferredSize()); + gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize()); bounds.set_width(std::max(0, width() - GetScrollBarWidth())); - contents->SetBoundsRect(bounds); + contents()->SetBoundsRect(bounds); } void FixedSizedScrollView::OnMouseEntered(const ui::MouseEvent& event) { |