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_WINDOW_DIALOG_CLIENT_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_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/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Update |button|'s text and enabled state according to the delegate's state. | 87 // Update |button|'s text and enabled state according to the delegate's state. |
88 void UpdateButton(LabelButton* button, ui::DialogButton type); | 88 void UpdateButton(LabelButton* button, ui::DialogButton type); |
89 | 89 |
90 // Returns the height of the row containing the buttons and the extra view. | 90 // Returns the height of the row containing the buttons and the extra view. |
91 int GetButtonsAndExtraViewRowHeight() const; | 91 int GetButtonsAndExtraViewRowHeight() const; |
92 | 92 |
93 // Returns the insets for the buttons and extra view. | 93 // Returns the insets for the buttons and extra view. |
94 gfx::Insets GetButtonRowInsets() const; | 94 gfx::Insets GetButtonRowInsets() const; |
95 | 95 |
| 96 // Closes the widget. |
| 97 void Close(); |
| 98 |
96 // Sets up the focus chain for the child views. This is required since the | 99 // Sets up the focus chain for the child views. This is required since the |
97 // delegate may choose to add/remove views at any time. | 100 // delegate may choose to add/remove views at any time. |
98 void SetupFocusChain(); | 101 void SetupFocusChain(); |
99 | 102 |
100 // The dialog buttons. | 103 // The dialog buttons. |
101 LabelButton* ok_button_; | 104 LabelButton* ok_button_; |
102 LabelButton* cancel_button_; | 105 LabelButton* cancel_button_; |
103 | 106 |
104 // The extra view shown in the row of buttons; may be NULL. | 107 // The extra view shown in the row of buttons; may be NULL. |
105 View* extra_view_; | 108 View* extra_view_; |
106 | 109 |
107 // The footnote view shown below the buttons; may be NULL. | 110 // The footnote view shown below the buttons; may be NULL. |
108 View* footnote_view_; | 111 View* footnote_view_; |
109 | 112 |
110 // True if we've notified the delegate the window is closing and the delegate | 113 // True if we've notified the delegate the window is closing and the delegate |
111 // allowed the close. In some situations it's possible to get two closes (see | 114 // allosed the close. In some situations it's possible to get two closes (see |
112 // http://crbug.com/71940). This is used to avoid notifying the delegate | 115 // http://crbug.com/71940). This is used to avoid notifying the delegate |
113 // twice, which can have bad consequences. | 116 // twice, which can have bad consequences. |
114 bool delegate_allowed_close_; | 117 bool notified_delegate_; |
115 | 118 |
116 DISALLOW_COPY_AND_ASSIGN(DialogClientView); | 119 DISALLOW_COPY_AND_ASSIGN(DialogClientView); |
117 }; | 120 }; |
118 | 121 |
119 } // namespace views | 122 } // namespace views |
120 | 123 |
121 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 124 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
OLD | NEW |