| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_DIALOG_DELEGATE_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ |
| 6 #define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 const gfx::Insets& anchor_view_insets() const { return anchor_view_insets_; } | 83 const gfx::Insets& anchor_view_insets() const { return anchor_view_insets_; } |
| 84 void set_anchor_view_insets(const gfx::Insets& i) { anchor_view_insets_ = i; } | 84 void set_anchor_view_insets(const gfx::Insets& i) { anchor_view_insets_ = i; } |
| 85 | 85 |
| 86 gfx::NativeView parent_window() const { return parent_window_; } | 86 gfx::NativeView parent_window() const { return parent_window_; } |
| 87 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } | 87 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } |
| 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_; } | |
| 93 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } | |
| 94 | |
| 95 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } | 92 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } |
| 96 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } | 93 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } |
| 97 | 94 |
| 98 // Get the arrow's anchor rect in screen space. | 95 // Get the arrow's anchor rect in screen space. |
| 99 virtual gfx::Rect GetAnchorRect() const; | 96 virtual gfx::Rect GetAnchorRect() const; |
| 100 | 97 |
| 101 // Allows delegates to provide custom parameters before widget initialization. | 98 // Allows delegates to provide custom parameters before widget initialization. |
| 102 // For example, mus needs to set a custom ui::Window* parent. | 99 // For example, mus needs to set a custom ui::Window* parent. |
| 103 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params, | 100 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params, |
| 104 Widget* widget) const; | 101 Widget* widget) const; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool color_explicitly_set_; | 186 bool color_explicitly_set_; |
| 190 | 187 |
| 191 // The margins between the content and the inside of the border. | 188 // The margins between the content and the inside of the border. |
| 192 gfx::Insets margins_; | 189 gfx::Insets margins_; |
| 193 | 190 |
| 194 // Insets applied to the |anchor_view_| bounds. | 191 // Insets applied to the |anchor_view_| bounds. |
| 195 gfx::Insets anchor_view_insets_; | 192 gfx::Insets anchor_view_insets_; |
| 196 | 193 |
| 197 // Specifies whether the bubble (or its border) handles mouse events, etc. | 194 // Specifies whether the bubble (or its border) handles mouse events, etc. |
| 198 bool accept_events_; | 195 bool accept_events_; |
| 199 bool border_accepts_events_; | |
| 200 | 196 |
| 201 // If true (defaults to true), the arrow may be mirrored and moved to fit the | 197 // If true (defaults to true), the arrow may be mirrored and moved to fit the |
| 202 // bubble on screen better. It would be a no-op if the bubble has no arrow. | 198 // bubble on screen better. It would be a no-op if the bubble has no arrow. |
| 203 bool adjust_if_offscreen_; | 199 bool adjust_if_offscreen_; |
| 204 | 200 |
| 205 // Parent native window of the bubble. | 201 // Parent native window of the bubble. |
| 206 gfx::NativeView parent_window_; | 202 gfx::NativeView parent_window_; |
| 207 | 203 |
| 208 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); | 204 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); |
| 209 }; | 205 }; |
| 210 | 206 |
| 211 } // namespace views | 207 } // namespace views |
| 212 | 208 |
| 213 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ | 209 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ |
| OLD | NEW |