| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 gfx::Rect OverflowBubbleView::GetBubbleBounds() { | 179 gfx::Rect OverflowBubbleView::GetBubbleBounds() { |
| 180 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); | 180 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); |
| 181 gfx::Insets bubble_insets = border->GetInsets(); | 181 gfx::Insets bubble_insets = border->GetInsets(); |
| 182 | 182 |
| 183 const int border_size = | 183 const int border_size = |
| 184 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? | 184 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? |
| 185 bubble_insets.left() : bubble_insets.top(); | 185 bubble_insets.left() : bubble_insets.top(); |
| 186 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + | 186 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + |
| 187 ShelfLayoutManager::GetPreferredShelfSize() / 2; | 187 kShelfSize / 2; |
| 188 | 188 |
| 189 const gfx::Size content_size = GetPreferredSize(); | 189 const gfx::Size content_size = GetPreferredSize(); |
| 190 border->set_arrow_offset(arrow_offset); | 190 border->set_arrow_offset(arrow_offset); |
| 191 | 191 |
| 192 const gfx::Rect anchor_rect = GetAnchorRect(); | 192 const gfx::Rect anchor_rect = GetAnchorRect(); |
| 193 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( | 193 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( |
| 194 anchor_rect, | 194 anchor_rect, |
| 195 content_size, | 195 content_size, |
| 196 false); | 196 false); |
| 197 | 197 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 215 | 215 |
| 216 bubble_rect.Offset(0, offset); | 216 bubble_rect.Offset(0, offset); |
| 217 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); | 217 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 GetBubbleFrameView()->SchedulePaint(); | 220 GetBubbleFrameView()->SchedulePaint(); |
| 221 return bubble_rect; | 221 return bubble_rect; |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace ash | 224 } // namespace ash |
| OLD | NEW |