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 #ifndef UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/views/bubble/bubble_delegate.h" | 9 #include "ui/views/bubble/bubble_delegate.h" |
10 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace views { | 26 namespace views { |
27 | 27 |
28 namespace internal { | 28 namespace internal { |
29 class TrayBubbleBorder; | 29 class TrayBubbleBorder; |
30 class TrayBubbleContentMask; | 30 class TrayBubbleContentMask; |
31 } | 31 } |
32 | 32 |
33 class VIEWS_EXPORT TrayBubbleView : public views::BubbleDelegateView { | 33 class VIEWS_EXPORT TrayBubbleView : public views::BubbleDelegateView { |
34 public: | 34 public: |
| 35 // AnchorType differentiates between bubbles that are anchored on a tray |
| 36 // element (ANCHOR_TYPE_TRAY) and display an arrow, or that are floating on |
| 37 // the screen away from the tray (ANCHOR_TYPE_BUBBLE). |
35 enum AnchorType { | 38 enum AnchorType { |
36 ANCHOR_TYPE_TRAY, | 39 ANCHOR_TYPE_TRAY, |
37 ANCHOR_TYPE_BUBBLE | 40 ANCHOR_TYPE_BUBBLE, |
38 }; | 41 }; |
39 | 42 |
| 43 // AnchorAlignment determines to which side of the anchor the bubble will |
| 44 // align itself. |
40 enum AnchorAlignment { | 45 enum AnchorAlignment { |
41 ANCHOR_ALIGNMENT_BOTTOM, | 46 ANCHOR_ALIGNMENT_BOTTOM, |
42 ANCHOR_ALIGNMENT_LEFT, | 47 ANCHOR_ALIGNMENT_LEFT, |
43 ANCHOR_ALIGNMENT_RIGHT, | 48 ANCHOR_ALIGNMENT_RIGHT, |
44 ANCHOR_ALIGNMENT_TOP | 49 ANCHOR_ALIGNMENT_TOP |
45 }; | 50 }; |
46 | 51 |
47 class VIEWS_EXPORT Delegate { | 52 class VIEWS_EXPORT Delegate { |
48 public: | 53 public: |
49 typedef TrayBubbleView::AnchorType AnchorType; | 54 typedef TrayBubbleView::AnchorType AnchorType; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 int min_width; | 95 int min_width; |
91 int max_width; | 96 int max_width; |
92 int max_height; | 97 int max_height; |
93 bool can_activate; | 98 bool can_activate; |
94 bool close_on_deactivate; | 99 bool close_on_deactivate; |
95 SkColor arrow_color; | 100 SkColor arrow_color; |
96 views::BubbleBorder::ArrowLocation arrow_location; | 101 views::BubbleBorder::ArrowLocation arrow_location; |
97 int arrow_offset; | 102 int arrow_offset; |
98 bool hide_arrow; // hides arrow, but may still use "arrow geometry" | 103 bool hide_arrow; // hides arrow, but may still use "arrow geometry" |
99 views::BubbleBorder::Shadow shadow; | 104 views::BubbleBorder::Shadow shadow; |
| 105 views::BubbleBorder::BubbleAlignment arrow_alignment; |
100 }; | 106 }; |
101 | 107 |
102 // Constructs and returns a TrayBubbleView. init_params may be modified. | 108 // Constructs and returns a TrayBubbleView. init_params may be modified. |
103 static TrayBubbleView* Create(gfx::NativeView parent_window, | 109 static TrayBubbleView* Create(gfx::NativeView parent_window, |
104 views::View* anchor, | 110 views::View* anchor, |
105 Delegate* delegate, | 111 Delegate* delegate, |
106 InitParams* init_params); | 112 InitParams* init_params); |
107 | 113 |
108 virtual ~TrayBubbleView(); | 114 virtual ~TrayBubbleView(); |
109 | 115 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 internal::TrayBubbleBorder* bubble_border_; | 179 internal::TrayBubbleBorder* bubble_border_; |
174 scoped_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; | 180 scoped_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; |
175 bool is_gesture_dragging_; | 181 bool is_gesture_dragging_; |
176 | 182 |
177 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 183 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
178 }; | 184 }; |
179 | 185 |
180 } // namespace views | 186 } // namespace views |
181 | 187 |
182 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 188 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
OLD | NEW |