| 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/common/shelf/overflow_bubble_view.h" | 5 #include "ash/common/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 ? kShelfBaseColor | 53 ? kShelfBaseColor |
| 54 : SkColorSetA(kShelfBaseColor, | 54 : SkColorSetA(kShelfBaseColor, |
| 55 GetShelfConstant(SHELF_BACKGROUND_ALPHA)); | 55 GetShelfConstant(SHELF_BACKGROUND_ALPHA)); |
| 56 set_color(color); | 56 set_color(color); |
| 57 set_margins(gfx::Insets(kPadding, kPadding, kPadding, kPadding)); | 57 set_margins(gfx::Insets(kPadding, kPadding, kPadding, kPadding)); |
| 58 // Overflow bubble should not get focus. If it get focus when it is shown, | 58 // Overflow bubble should not get focus. If it get focus when it is shown, |
| 59 // active state item is changed to running state. | 59 // active state item is changed to running state. |
| 60 set_can_activate(false); | 60 set_can_activate(false); |
| 61 | 61 |
| 62 // Makes bubble view has a layer and clip its children layers. | 62 // Makes bubble view has a layer and clip its children layers. |
| 63 SetPaintToLayer(true); | 63 SetPaintToLayer(); |
| 64 layer()->SetFillsBoundsOpaquely(false); | 64 layer()->SetFillsBoundsOpaquely(false); |
| 65 layer()->SetMasksToBounds(true); | 65 layer()->SetMasksToBounds(true); |
| 66 | 66 |
| 67 // Calls into OnBeforeBubbleWidgetInit to set the window parent container. | 67 // Calls into OnBeforeBubbleWidgetInit to set the window parent container. |
| 68 views::BubbleDialogDelegateView::CreateBubble(this); | 68 views::BubbleDialogDelegateView::CreateBubble(this); |
| 69 AddChildView(shelf_view_); | 69 AddChildView(shelf_view_); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool OverflowBubbleView::IsHorizontalAlignment() const { | 72 bool OverflowBubbleView::IsHorizontalAlignment() const { |
| 73 return ::ash::IsHorizontalAlignment(wm_shelf_->GetAlignment()); | 73 return ::ash::IsHorizontalAlignment(wm_shelf_->GetAlignment()); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 bubble_rect.Offset(0, offset); | 230 bubble_rect.Offset(0, offset); |
| 231 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); | 231 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 GetBubbleFrameView()->SchedulePaint(); | 234 GetBubbleFrameView()->SchedulePaint(); |
| 235 return bubble_rect; | 235 return bubble_rect; |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace ash | 238 } // namespace ash |
| OLD | NEW |