| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // WidgetDelegateView overrides: | 42 // WidgetDelegateView overrides: |
| 43 BubbleDialogDelegateView* AsBubbleDialogDelegate() override; | 43 BubbleDialogDelegateView* AsBubbleDialogDelegate() override; |
| 44 bool ShouldShowCloseButton() const override; | 44 bool ShouldShowCloseButton() const override; |
| 45 ClientView* CreateClientView(Widget* widget) override; | 45 ClientView* CreateClientView(Widget* widget) override; |
| 46 NonClientFrameView* CreateNonClientFrameView(Widget* widget) override; | 46 NonClientFrameView* CreateNonClientFrameView(Widget* widget) override; |
| 47 void GetAccessibleState(ui::AXViewState* state) override; | 47 void GetAccessibleState(ui::AXViewState* state) override; |
| 48 const char* GetClassName() const override; | 48 const char* GetClassName() const override; |
| 49 | 49 |
| 50 // WidgetObserver overrides: | 50 // WidgetObserver overrides: |
| 51 void OnWidgetClosing(Widget* widget) override; | |
| 52 void OnWidgetDestroying(Widget* widget) override; | 51 void OnWidgetDestroying(Widget* widget) override; |
| 53 void OnWidgetVisibilityChanging(Widget* widget, bool visible) override; | 52 void OnWidgetVisibilityChanging(Widget* widget, bool visible) override; |
| 54 void OnWidgetVisibilityChanged(Widget* widget, bool visible) override; | 53 void OnWidgetVisibilityChanged(Widget* widget, bool visible) override; |
| 55 void OnWidgetActivationChanged(Widget* widget, bool active) override; | 54 void OnWidgetActivationChanged(Widget* widget, bool active) override; |
| 56 void OnWidgetBoundsChanged(Widget* widget, | 55 void OnWidgetBoundsChanged(Widget* widget, |
| 57 const gfx::Rect& new_bounds) override; | 56 const gfx::Rect& new_bounds) override; |
| 58 | 57 |
| 59 bool close_on_deactivate() const { return close_on_deactivate_; } | 58 bool close_on_deactivate() const { return close_on_deactivate_; } |
| 60 void set_close_on_deactivate(bool close) { close_on_deactivate_ = close; } | 59 void set_close_on_deactivate(bool close) { close_on_deactivate_ = close; } |
| 61 | 60 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 88 | 87 |
| 89 bool accept_events() const { return accept_events_; } | 88 bool accept_events() const { return accept_events_; } |
| 90 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } | 89 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } |
| 91 | 90 |
| 92 bool border_accepts_events() const { return border_accepts_events_; } | 91 bool border_accepts_events() const { return border_accepts_events_; } |
| 93 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } | 92 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } |
| 94 | 93 |
| 95 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } | 94 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } |
| 96 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } | 95 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } |
| 97 | 96 |
| 98 CloseReason close_reason() const { return close_reason_; } | |
| 99 | |
| 100 // Get the arrow's anchor rect in screen space. | 97 // Get the arrow's anchor rect in screen space. |
| 101 virtual gfx::Rect GetAnchorRect() const; | 98 virtual gfx::Rect GetAnchorRect() const; |
| 102 | 99 |
| 103 // Allows delegates to provide custom parameters before widget initialization. | 100 // Allows delegates to provide custom parameters before widget initialization. |
| 104 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params, | 101 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params, |
| 105 Widget* widget) const; | 102 Widget* widget) const; |
| 106 | 103 |
| 107 // Sets |margins_| to a default picked for smaller bubbles. | 104 // Sets |margins_| to a default picked for smaller bubbles. |
| 108 void UseCompactMargins(); | 105 void UseCompactMargins(); |
| 109 | 106 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bool accept_events_; | 190 bool accept_events_; |
| 194 bool border_accepts_events_; | 191 bool border_accepts_events_; |
| 195 | 192 |
| 196 // 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 |
| 197 // 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. |
| 198 bool adjust_if_offscreen_; | 195 bool adjust_if_offscreen_; |
| 199 | 196 |
| 200 // Parent native window of the bubble. | 197 // Parent native window of the bubble. |
| 201 gfx::NativeView parent_window_; | 198 gfx::NativeView parent_window_; |
| 202 | 199 |
| 203 CloseReason close_reason_; | |
| 204 | |
| 205 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); | 200 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); |
| 206 }; | 201 }; |
| 207 | 202 |
| 208 } // namespace views | 203 } // namespace views |
| 209 | 204 |
| 210 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ | 205 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ |
| OLD | NEW |