| 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/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 gfx::Rect OverflowBubbleView::GetBubbleBounds() { | 174 gfx::Rect OverflowBubbleView::GetBubbleBounds() { |
| 175 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); | 175 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); |
| 176 gfx::Insets bubble_insets = border->GetInsets(); | 176 gfx::Insets bubble_insets = border->GetInsets(); |
| 177 | 177 |
| 178 const int border_size = | 178 const int border_size = |
| 179 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? | 179 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? |
| 180 bubble_insets.left() : bubble_insets.top(); | 180 bubble_insets.left() : bubble_insets.top(); |
| 181 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + | 181 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + |
| 182 kShelfSize / 2; | 182 GetShelfConstant(SHELF_SIZE) / 2; |
| 183 | 183 |
| 184 const gfx::Size content_size = GetPreferredSize(); | 184 const gfx::Size content_size = GetPreferredSize(); |
| 185 border->set_arrow_offset(arrow_offset); | 185 border->set_arrow_offset(arrow_offset); |
| 186 | 186 |
| 187 const gfx::Rect anchor_rect = GetAnchorRect(); | 187 const gfx::Rect anchor_rect = GetAnchorRect(); |
| 188 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( | 188 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( |
| 189 anchor_rect, | 189 anchor_rect, |
| 190 content_size, | 190 content_size, |
| 191 false); | 191 false); |
| 192 | 192 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 212 | 212 |
| 213 bubble_rect.Offset(0, offset); | 213 bubble_rect.Offset(0, offset); |
| 214 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); | 214 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); |
| 215 } | 215 } |
| 216 | 216 |
| 217 GetBubbleFrameView()->SchedulePaint(); | 217 GetBubbleFrameView()->SchedulePaint(); |
| 218 return bubble_rect; | 218 return bubble_rect; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace ash | 221 } // namespace ash |
| OLD | NEW |