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_BUBBLE_DELEGATE_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "ui/views/bubble/bubble_border.h" | 9 #include "ui/views/bubble/bubble_border.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 const gfx::Insets& margins() const { return margins_; } | 77 const gfx::Insets& margins() const { return margins_; } |
78 void set_margins(const gfx::Insets& margins) { margins_ = margins; } | 78 void set_margins(const gfx::Insets& margins) { margins_ = margins; } |
79 | 79 |
80 const gfx::Insets& anchor_view_insets() const { return anchor_view_insets_; } | 80 const gfx::Insets& anchor_view_insets() const { return anchor_view_insets_; } |
81 void set_anchor_view_insets(const gfx::Insets& i) { anchor_view_insets_ = i; } | 81 void set_anchor_view_insets(const gfx::Insets& i) { anchor_view_insets_ = i; } |
82 | 82 |
83 gfx::NativeView parent_window() const { return parent_window_; } | 83 gfx::NativeView parent_window() const { return parent_window_; } |
84 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } | 84 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } |
85 | 85 |
86 bool use_focusless() const { return use_focusless_; } | 86 bool can_activate() const { return can_activate_; } |
87 void set_use_focusless(bool focusless) { use_focusless_ = focusless; } | 87 void set_can_activate(bool focusless) { can_activate_ = focusless; } |
88 | 88 |
89 bool accept_events() const { return accept_events_; } | 89 bool accept_events() const { return accept_events_; } |
90 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } | 90 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } |
91 | 91 |
92 bool border_accepts_events() const { return border_accepts_events_; } | 92 bool border_accepts_events() const { return border_accepts_events_; } |
93 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } | 93 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } |
94 | 94 |
95 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } | 95 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } |
96 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } | 96 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } |
97 | 97 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // The background color of the bubble; and flag for when it's explicitly set. | 176 // The background color of the bubble; and flag for when it's explicitly set. |
177 SkColor color_; | 177 SkColor color_; |
178 bool color_explicitly_set_; | 178 bool color_explicitly_set_; |
179 | 179 |
180 // The margins between the content and the inside of the border. | 180 // The margins between the content and the inside of the border. |
181 gfx::Insets margins_; | 181 gfx::Insets margins_; |
182 | 182 |
183 // Insets applied to the |anchor_view_| bounds. | 183 // Insets applied to the |anchor_view_| bounds. |
184 gfx::Insets anchor_view_insets_; | 184 gfx::Insets anchor_view_insets_; |
185 | 185 |
186 // If true, the bubble does not take focus on display; default is false. | 186 // If false, the bubble can't be activated; default is true. |
187 bool use_focusless_; | 187 bool can_activate_; |
188 | 188 |
189 // Specifies whether the bubble (or its border) handles mouse events, etc. | 189 // Specifies whether the bubble (or its border) handles mouse events, etc. |
190 bool accept_events_; | 190 bool accept_events_; |
191 bool border_accepts_events_; | 191 bool border_accepts_events_; |
192 | 192 |
193 // If true (defaults to true), the arrow may be mirrored and moved to fit the | 193 // If true (defaults to true), the arrow may be mirrored and moved to fit the |
194 // bubble on screen better. It would be a no-op if the bubble has no arrow. | 194 // bubble on screen better. It would be a no-op if the bubble has no arrow. |
195 bool adjust_if_offscreen_; | 195 bool adjust_if_offscreen_; |
196 | 196 |
197 // Parent native window of the bubble. | 197 // Parent native window of the bubble. |
198 gfx::NativeView parent_window_; | 198 gfx::NativeView parent_window_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 200 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace views | 203 } // namespace views |
204 | 204 |
205 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 205 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
OLD | NEW |