OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Inset the arrow a bit from the edge. | 30 // Inset the arrow a bit from the edge. |
31 const int kArrowMinOffset = 20; | 31 const int kArrowMinOffset = 20; |
32 const int kBubbleSpacing = 20; | 32 const int kBubbleSpacing = 20; |
33 | 33 |
34 // The new theme adjusts the menus / bubbles to be flush with the shelf when | 34 // The new theme adjusts the menus / bubbles to be flush with the shelf when |
35 // there is no bubble. These are the offsets which need to be applied. | 35 // there is no bubble. These are the offsets which need to be applied. |
36 const int kArrowOffsetTopBottom = 5; | 36 const int kArrowOffsetTopBottom = 4; |
37 const int kArrowOffsetLeft = 9; | 37 const int kArrowOffsetLeft = 9; |
38 const int kArrowOffsetRight = -5; | 38 const int kArrowOffsetRight = -5; |
39 const int kOffsetLeftRightForTopBottomOrientation = 2; | 39 const int kOffsetLeftRightForTopBottomOrientation = 5; |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 namespace views { | 43 namespace views { |
44 | 44 |
45 namespace internal { | 45 namespace internal { |
46 | 46 |
47 // Custom border for TrayBubbleView. Contains special logic for GetBounds() | 47 // Custom border for TrayBubbleView. Contains special logic for GetBounds() |
48 // to stack bubbles with no arrows correctly. Also calculates the arrow offset. | 48 // to stack bubbles with no arrows correctly. Also calculates the arrow offset. |
49 class TrayBubbleBorder : public BubbleBorder { | 49 class TrayBubbleBorder : public BubbleBorder { |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 const ViewHierarchyChangedDetails& details) { | 440 const ViewHierarchyChangedDetails& details) { |
441 if (get_use_acceleration_when_possible() && details.is_add && | 441 if (get_use_acceleration_when_possible() && details.is_add && |
442 details.child == this) { | 442 details.child == this) { |
443 details.parent->SetPaintToLayer(true); | 443 details.parent->SetPaintToLayer(true); |
444 details.parent->SetFillsBoundsOpaquely(true); | 444 details.parent->SetFillsBoundsOpaquely(true); |
445 details.parent->layer()->SetMasksToBounds(true); | 445 details.parent->layer()->SetMasksToBounds(true); |
446 } | 446 } |
447 } | 447 } |
448 | 448 |
449 } // namespace views | 449 } // namespace views |
OLD | NEW |