| 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/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 View* anchor_view() const { return anchor_view_; } | 62 View* anchor_view() const { return anchor_view_; } |
| 63 Widget* anchor_widget() const { return anchor_widget_; } | 63 Widget* anchor_widget() const { return anchor_widget_; } |
| 64 | 64 |
| 65 BubbleBorder::ArrowLocation arrow_location() const { return arrow_location_; } | 65 BubbleBorder::ArrowLocation arrow_location() const { return arrow_location_; } |
| 66 void set_arrow_location(BubbleBorder::ArrowLocation arrow_location) { | 66 void set_arrow_location(BubbleBorder::ArrowLocation arrow_location) { |
| 67 arrow_location_ = arrow_location; | 67 arrow_location_ = arrow_location; |
| 68 } | 68 } |
| 69 | 69 |
| 70 BubbleBorder::Shadow shadow() const { return shadow_; } |
| 71 void set_shadow(BubbleBorder::Shadow shadow) { shadow_ = shadow; } |
| 72 |
| 70 SkColor color() const { return color_; } | 73 SkColor color() const { return color_; } |
| 71 void set_color(SkColor color) { color_ = color; } | 74 void set_color(SkColor color) { color_ = color; } |
| 72 | 75 |
| 73 const gfx::Insets& margins() const { return margins_; } | 76 const gfx::Insets& margins() const { return margins_; } |
| 74 void set_margins(const gfx::Insets& margins) { margins_ = margins; } | 77 void set_margins(const gfx::Insets& margins) { margins_ = margins; } |
| 75 | 78 |
| 76 void set_anchor_insets(const gfx::Insets& insets) { anchor_insets_ = insets; } | 79 void set_anchor_insets(const gfx::Insets& insets) { anchor_insets_ = insets; } |
| 77 const gfx::Insets& anchor_insets() const { return anchor_insets_; } | 80 const gfx::Insets& anchor_insets() const { return anchor_insets_; } |
| 78 | 81 |
| 79 gfx::NativeView parent_window() const { return parent_window_; } | 82 gfx::NativeView parent_window() const { return parent_window_; } |
| 80 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } | 83 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } |
| 81 | 84 |
| 82 bool use_focusless() const { return use_focusless_; } | 85 bool use_focusless() const { return use_focusless_; } |
| 83 void set_use_focusless(bool use_focusless) { | 86 void set_use_focusless(bool use_focusless) { |
| 84 use_focusless_ = use_focusless; | 87 use_focusless_ = use_focusless; |
| 85 } | 88 } |
| 86 | 89 |
| 87 bool accept_events() const { return accept_events_; } | 90 bool accept_events() const { return accept_events_; } |
| 88 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } | 91 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } |
| 89 | 92 |
| 90 bool try_mirroring_arrow() const { return try_mirroring_arrow_; } | 93 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } |
| 91 void set_try_mirroring_arrow(bool try_mirroring_arrow) { | 94 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } |
| 92 try_mirroring_arrow_ = try_mirroring_arrow; | |
| 93 } | |
| 94 | 95 |
| 95 // Get the arrow's anchor rect in screen space. | 96 // Get the arrow's anchor rect in screen space. |
| 96 virtual gfx::Rect GetAnchorRect(); | 97 virtual gfx::Rect GetAnchorRect(); |
| 97 | 98 |
| 98 // Show the bubble's widget (and |border_widget_| on Windows). | 99 // Show the bubble's widget (and |border_widget_| on Windows). |
| 99 void Show(); | 100 void Show(); |
| 100 | 101 |
| 101 // Fade the bubble in or out via Widget transparency. | 102 // Fade the bubble in or out via Widget transparency. |
| 102 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. | 103 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. |
| 103 void StartFade(bool fade_in); | 104 void StartFade(bool fade_in); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 167 |
| 167 // The anchor point used in the absence of an anchor view. | 168 // The anchor point used in the absence of an anchor view. |
| 168 gfx::Point anchor_point_; | 169 gfx::Point anchor_point_; |
| 169 | 170 |
| 170 // If true, the bubble will re-anchor (and may resize) with |anchor_widget_|. | 171 // If true, the bubble will re-anchor (and may resize) with |anchor_widget_|. |
| 171 bool move_with_anchor_; | 172 bool move_with_anchor_; |
| 172 | 173 |
| 173 // The arrow's location on the bubble. | 174 // The arrow's location on the bubble. |
| 174 BubbleBorder::ArrowLocation arrow_location_; | 175 BubbleBorder::ArrowLocation arrow_location_; |
| 175 | 176 |
| 177 // Bubble border shadow to use. |
| 178 BubbleBorder::Shadow shadow_; |
| 179 |
| 176 // The background color of the bubble. | 180 // The background color of the bubble. |
| 177 SkColor color_; | 181 SkColor color_; |
| 178 | 182 |
| 179 // The margins between the content and the inside of the border. | 183 // The margins between the content and the inside of the border. |
| 180 gfx::Insets margins_; | 184 gfx::Insets margins_; |
| 181 | 185 |
| 182 // Insets applied to the |anchor_view_| bounds. | 186 // Insets applied to the |anchor_view_| bounds. |
| 183 gfx::Insets anchor_insets_; | 187 gfx::Insets anchor_insets_; |
| 184 | 188 |
| 185 // Original opacity of the bubble. | 189 // Original opacity of the bubble. |
| 186 int original_opacity_; | 190 int original_opacity_; |
| 187 | 191 |
| 188 // The widget hosting the border for this bubble (non-Aura Windows only). | 192 // The widget hosting the border for this bubble (non-Aura Windows only). |
| 189 Widget* border_widget_; | 193 Widget* border_widget_; |
| 190 | 194 |
| 191 // Create a popup window for focusless bubbles on Linux/ChromeOS. | 195 // Create a popup window for focusless bubbles on Linux/ChromeOS. |
| 192 // These bubbles are not interactive and should not gain focus. | 196 // These bubbles are not interactive and should not gain focus. |
| 193 bool use_focusless_; | 197 bool use_focusless_; |
| 194 | 198 |
| 195 // Specifies whether the popup accepts events or lets them pass through. | 199 // Specifies whether the popup accepts events or lets them pass through. |
| 196 bool accept_events_; | 200 bool accept_events_; |
| 197 | 201 |
| 198 // If true (defaults to true), the arrow may be mirrored to fit the | 202 // If true (defaults to true), the arrow may be mirrored and moved to fit the |
| 199 // bubble on screen better. | 203 // bubble on screen better. It would be a no-op if the bubble has no arrow. |
| 200 bool try_mirroring_arrow_; | 204 bool adjust_if_offscreen_; |
| 201 | 205 |
| 202 // Parent native window of the bubble. | 206 // Parent native window of the bubble. |
| 203 gfx::NativeView parent_window_; | 207 gfx::NativeView parent_window_; |
| 204 | 208 |
| 205 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 209 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
| 206 }; | 210 }; |
| 207 | 211 |
| 208 } // namespace views | 212 } // namespace views |
| 209 | 213 |
| 210 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 214 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| OLD | NEW |