Chromium Code Reviews| Index: ash/shelf/overflow_bubble_view.cc |
| diff --git a/ash/shelf/overflow_bubble_view.cc b/ash/shelf/overflow_bubble_view.cc |
| index 5273e50684bdde0e6c1e5342a97d60b663a4927c..158d74592254870b936835170b13b4b90d2c4648 100644 |
| --- a/ash/shelf/overflow_bubble_view.cc |
| +++ b/ash/shelf/overflow_bubble_view.cc |
| @@ -41,8 +41,6 @@ OverflowBubbleView::~OverflowBubbleView() { |
| void OverflowBubbleView::InitOverflowBubble(views::View* anchor, |
| ShelfView* shelf_view) { |
| - // set_anchor_view needs to be called before GetShelfLayoutManager() can be |
| - // called. |
| SetAnchorView(anchor); |
| set_arrow(GetBubbleArrow()); |
| set_background(NULL); |
| @@ -67,7 +65,8 @@ void OverflowBubbleView::InitOverflowBubble(views::View* anchor, |
| } |
| bool OverflowBubbleView::IsHorizontalAlignment() const { |
| - ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
| + ShelfLayoutManager* shelf_layout_manager = |
| + shelf_view_ ? shelf_view_->shelf_layout_manager() : nullptr; |
| return shelf_layout_manager ? shelf_layout_manager->IsHorizontalAlignment() |
| : false; |
| } |
| @@ -78,7 +77,8 @@ const gfx::Size OverflowBubbleView::GetContentsSize() const { |
| // Gets arrow location based on shelf alignment. |
| views::BubbleBorder::Arrow OverflowBubbleView::GetBubbleArrow() const { |
| - ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
| + ShelfLayoutManager* shelf_layout_manager = |
|
sky
2016/02/03 00:01:42
nit: keep GetShelfLayoutManager but makes it imple
sadrul
2016/02/03 02:07:58
Done.
|
| + shelf_view_ ? shelf_view_->shelf_layout_manager() : nullptr; |
| return shelf_layout_manager ? |
| shelf_layout_manager->SelectValueForShelfAlignment( |
| views::BubbleBorder::BOTTOM_LEFT, |
| @@ -164,12 +164,6 @@ bool OverflowBubbleView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
| return true; |
| } |
| -ShelfLayoutManager* OverflowBubbleView::GetShelfLayoutManager() const { |
| - return GetAnchorView() ? ShelfLayoutManager::ForShelf( |
| - GetAnchorView()->GetWidget()->GetNativeView()) |
| - : NULL; |
| -} |
| - |
| void OverflowBubbleView::OnScrollEvent(ui::ScrollEvent* event) { |
| ScrollByXOffset(-event->x_offset()); |
| ScrollByYOffset(-event->y_offset()); |