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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 8863009: Fix alignment of avatar bubbles in the NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use Rect::Ofset() Created 9 years 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
« ui/views/bubble/bubble_frame_view.h ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 11d1b2061dbd11035d9635ecb629c97ce7509e76..fdf073227597973c5dd6802c981ea144240edb52 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -26,8 +26,8 @@ BubbleFrameView::BubbleFrameView(BubbleBorder::ArrowLocation location,
bubble_border()->set_background_color(color);
SetLayoutManager(new views::FillLayout());
AddChildView(border_contents_);
- gfx::Rect bounds(gfx::Point(), client_size);
- gfx::Rect windows_bounds = GetWindowBoundsForClientBounds(bounds);
+ gfx::Rect windows_bounds =
+ GetWindowBoundsForAnchorAndClientSize(gfx::Rect(), client_size);
border_contents_->SetBoundsRect(
gfx::Rect(gfx::Point(), windows_bounds.size()));
SetBoundsRect(windows_bounds);
@@ -48,14 +48,19 @@ gfx::Rect BubbleFrameView::GetBoundsForClientView() const {
gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
// The |client_bounds| origin is the bubble arrow anchor point.
- gfx::Rect position_relative_to(client_bounds.origin(), gfx::Size());
+ gfx::Rect anchor(client_bounds.origin(), gfx::Size());
// The |client_bounds| size is the bubble client view size.
+ return GetWindowBoundsForAnchorAndClientSize(anchor, client_bounds.size());
+}
+
+gfx::Rect BubbleFrameView::GetWindowBoundsForAnchorAndClientSize(
+ const gfx::Rect& anchor, const gfx::Size& client_size) const {
msw 2011/12/08 00:40:14 Put params on independent lines.
sail 2011/12/08 01:41:10 Done.
gfx::Rect content_bounds;
gfx::Rect window_bounds;
- border_contents_->SizeAndGetBounds(position_relative_to,
+ border_contents_->SizeAndGetBounds(anchor,
location_,
allow_bubble_offscreen_,
- client_bounds.size(),
+ client_size,
&content_bounds,
&window_bounds);
return window_bounds;
« ui/views/bubble/bubble_frame_view.h ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698