| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shelf/overflow_bubble_view.h" | 5 #include "ash/shelf/overflow_bubble_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_constants.h" | 10 #include "ash/shelf/shelf_constants.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 gfx::Rect OverflowBubbleView::GetBubbleBounds() { | 181 gfx::Rect OverflowBubbleView::GetBubbleBounds() { |
| 182 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); | 182 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); |
| 183 gfx::Insets bubble_insets = border->GetInsets(); | 183 gfx::Insets bubble_insets = border->GetInsets(); |
| 184 | 184 |
| 185 const int border_size = | 185 const int border_size = |
| 186 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? | 186 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? |
| 187 bubble_insets.left() : bubble_insets.top(); | 187 bubble_insets.left() : bubble_insets.top(); |
| 188 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + | 188 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + |
| 189 kShelfSize / 2; | 189 ShelfLayoutManager::GetPreferredShelfSize() / 2; |
| 190 | 190 |
| 191 const gfx::Size content_size = GetPreferredSize(); | 191 const gfx::Size content_size = GetPreferredSize(); |
| 192 border->set_arrow_offset(arrow_offset); | 192 border->set_arrow_offset(arrow_offset); |
| 193 | 193 |
| 194 const gfx::Rect anchor_rect = GetAnchorRect(); | 194 const gfx::Rect anchor_rect = GetAnchorRect(); |
| 195 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( | 195 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( |
| 196 anchor_rect, | 196 anchor_rect, |
| 197 content_size, | 197 content_size, |
| 198 false); | 198 false); |
| 199 | 199 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 218 bubble_rect.Offset(0, offset); | 218 bubble_rect.Offset(0, offset); |
| 219 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); | 219 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); |
| 220 } | 220 } |
| 221 | 221 |
| 222 GetBubbleFrameView()->SchedulePaint(); | 222 GetBubbleFrameView()->SchedulePaint(); |
| 223 return bubble_rect; | 223 return bubble_rect; |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace internal | 226 } // namespace internal |
| 227 } // namespace ash | 227 } // namespace ash |
| OLD | NEW |