| 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" | |
| 10 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/wm_lookup.h" | 11 #include "ash/common/wm_lookup.h" |
| 13 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 14 #include "ash/public/cpp/shell_window_ids.h" | 13 #include "ash/public/cpp/shell_window_ids.h" |
| 15 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
| 16 #include "ui/display/display.h" | 15 #include "ui/display/display.h" |
| 17 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 18 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
| 19 #include "ui/gfx/geometry/insets.h" | 18 #include "ui/gfx/geometry/insets.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 OverflowBubbleView::~OverflowBubbleView() {} | 42 OverflowBubbleView::~OverflowBubbleView() {} |
| 44 | 43 |
| 45 void OverflowBubbleView::InitOverflowBubble(views::View* anchor, | 44 void OverflowBubbleView::InitOverflowBubble(views::View* anchor, |
| 46 views::View* shelf_view) { | 45 views::View* shelf_view) { |
| 47 shelf_view_ = shelf_view; | 46 shelf_view_ = shelf_view; |
| 48 | 47 |
| 49 SetAnchorView(anchor); | 48 SetAnchorView(anchor); |
| 50 set_arrow(GetBubbleArrow()); | 49 set_arrow(GetBubbleArrow()); |
| 51 set_mirror_arrow_in_rtl(false); | 50 set_mirror_arrow_in_rtl(false); |
| 52 set_background(NULL); | 51 set_background(NULL); |
| 53 SkColor color = MaterialDesignController::IsShelfMaterial() | 52 set_color(kShelfDefaultBaseColor); |
| 54 ? kShelfBaseColor | |
| 55 : SkColorSetA(kShelfBaseColor, kShelfTranslucentAlpha); | |
| 56 set_color(color); | |
| 57 set_margins(gfx::Insets(kPadding, kPadding, kPadding, kPadding)); | 53 set_margins(gfx::Insets(kPadding, kPadding, kPadding, kPadding)); |
| 58 // Overflow bubble should not get focus. If it get focus when it is shown, | 54 // Overflow bubble should not get focus. If it get focus when it is shown, |
| 59 // active state item is changed to running state. | 55 // active state item is changed to running state. |
| 60 set_can_activate(false); | 56 set_can_activate(false); |
| 61 | 57 |
| 62 // Makes bubble view has a layer and clip its children layers. | 58 // Makes bubble view has a layer and clip its children layers. |
| 63 SetPaintToLayer(); | 59 SetPaintToLayer(); |
| 64 layer()->SetFillsBoundsOpaquely(false); | 60 layer()->SetFillsBoundsOpaquely(false); |
| 65 layer()->SetMasksToBounds(true); | 61 layer()->SetMasksToBounds(true); |
| 66 | 62 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 221 |
| 226 bubble_rect.Offset(0, offset); | 222 bubble_rect.Offset(0, offset); |
| 227 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); | 223 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); |
| 228 } | 224 } |
| 229 | 225 |
| 230 GetBubbleFrameView()->SchedulePaint(); | 226 GetBubbleFrameView()->SchedulePaint(); |
| 231 return bubble_rect; | 227 return bubble_rect; |
| 232 } | 228 } |
| 233 | 229 |
| 234 } // namespace ash | 230 } // namespace ash |
| OLD | NEW |