Index: chrome/browser/notifications/balloon_collection_views.cc |
diff --git a/chrome/browser/notifications/balloon_collection_views.cc b/chrome/browser/notifications/balloon_collection_views.cc |
index c436df88881758b3090fd7f79486ebad823b81fe..995ff21d4985059897988adb81c3d263dcec0291 100644 |
--- a/chrome/browser/notifications/balloon_collection_views.cc |
+++ b/chrome/browser/notifications/balloon_collection_views.cc |
@@ -31,6 +31,39 @@ int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { |
return 0; |
} |
+gfx::Point BalloonCollectionImpl::Layout::GetLayoutOrigin() const { |
+ int x = 0; |
+ int y = 0; |
+ switch (placement_) { |
+ case VERTICALLY_FROM_TOP_LEFT: |
+ x = work_area_.x() + HorizontalEdgeMargin(); |
+ y = work_area_.y() + VerticalEdgeMargin(); |
+ break; |
+ case VERTICALLY_FROM_TOP_RIGHT: |
+ x = work_area_.right() - HorizontalEdgeMargin(); |
+ y = work_area_.y() + VerticalEdgeMargin(); |
+ break; |
+ case VERTICALLY_FROM_BOTTOM_LEFT: |
+ x = work_area_.x() + HorizontalEdgeMargin(); |
+ // For this placement, balloon needs to stay on top of left-most panels |
+ // to avoid overlapping. |
+ y = work_area_.bottom() - VerticalEdgeMargin() - |
+ bottom_left_offset_to_move_above_panels_; |
+ break; |
+ case VERTICALLY_FROM_BOTTOM_RIGHT: |
+ x = work_area_.right() - HorizontalEdgeMargin(); |
+ // For this placement, balloon needs to stay on top of right-most panels |
+ // to avoid overlapping. |
+ y = work_area_.bottom() - VerticalEdgeMargin() - |
+ bottom_right_offset_to_move_above_panels_; |
+ break; |
+ default: |
+ NOTREACHED(); |
+ break; |
+ } |
+ return gfx::Point(x, y); |
+} |
+ |
void BalloonCollectionImpl::PositionBalloons(bool reposition) { |
PositionBalloonsInternal(reposition); |
} |