diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 22:49:09 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 22:49:09 +0000 |
commit | fa742ee5562cf36b55dbd0f1f8ec5b9e131ca539 (patch) | |
tree | 7e5e9eea2197f2119f1d80b0c0a4531ad97570e9 /chrome/browser/ui/gtk/tabs | |
parent | b95700e633f8e4aa280fdaffe7e761c62d377221 (diff) | |
download | chromium_src-fa742ee5562cf36b55dbd0f1f8ec5b9e131ca539.zip chromium_src-fa742ee5562cf36b55dbd0f1f8ec5b9e131ca539.tar.gz chromium_src-fa742ee5562cf36b55dbd0f1f8ec5b9e131ca539.tar.bz2 |
Adding gfx::Rect::SplitVertically() method.
1) Code was replicated in dragged_tab_controller_gtk.cc and
dragged_tab_controller.cc, this allows the same code to be reused. Also removing the corresponding TODO.
2) The old SplitRectangleInTwo() function was violating the styleguide by having not const references as parameters.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/8137018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104199 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/tabs')
-rw-r--r-- | chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc index b8b8026..47989d6 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc @@ -44,18 +44,6 @@ gfx::Rect GetEffectiveBounds(const gfx::Rect& bounds) { return effective_bounds; } -// Splits |rectangle| in two halves, |left_half| and |right_half|. -// TODO(dpapad): Make this a method of gfx:Rect and use pointers instead of -// references. -void SplitRectangleInTwo( - const gfx::Rect rectangle, gfx::Rect& left_half, gfx::Rect& right_half) { - left_half = rectangle; - left_half.set_width(rectangle.width() / 2); - right_half = rectangle; - right_half.set_width(rectangle.width() - left_half.width()); - right_half.set_x(left_half.right()); -} - } // namespace DraggedTabControllerGtk::DraggedTabControllerGtk( @@ -549,7 +537,7 @@ int DraggedTabControllerGtk::GetInsertionIndexForDraggedBounds( // the halfway boundary necessary to move past the next tab. gfx::Rect ideal_bounds = attached_tabstrip_->GetIdealBounds(i); gfx::Rect left_half, right_half; - SplitRectangleInTwo(ideal_bounds, left_half, right_half); + ideal_bounds.SplitVertically(&left_half, &right_half); right_tab_x = right_half.x(); if (dragged_bounds_start >= right_half.x() && |