OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
6 #define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 6 #define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // when an accelerator is pressed, not at construction time. This | 61 // when an accelerator is pressed, not at construction time. This |
62 // returns true. | 62 // returns true. |
63 virtual bool AreAcceleratorsEnabled(ui::DialogButton button); | 63 virtual bool AreAcceleratorsEnabled(ui::DialogButton button); |
64 | 64 |
65 // Override this function if with a view which will be shown in the same | 65 // Override this function if with a view which will be shown in the same |
66 // row as the OK and CANCEL buttons but flush to the left and extending | 66 // row as the OK and CANCEL buttons but flush to the left and extending |
67 // up to the buttons. | 67 // up to the buttons. |
68 virtual View* GetExtraView(); | 68 virtual View* GetExtraView(); |
69 | 69 |
70 // Returns whether the height of the extra view should be at least as tall as | 70 // Returns whether the height of the extra view should be at least as tall as |
71 // the buttons. The default (false) is to give the extra view it's preferred | 71 // the buttons. The default (false) is to give the extra view its preferred |
72 // height. By returning true the height becomes | 72 // height. By returning true the height becomes |
73 // max(extra_view preferred height, buttons preferred height). | 73 // max(extra_view preferred height, buttons preferred height). |
74 virtual bool GetSizeExtraViewHeightToButtons(); | 74 virtual bool GetSizeExtraViewHeightToButtons(); |
75 | 75 |
76 // For Dialog boxes, if there is a "Cancel" button, this is called when the | 76 // For Dialog boxes, if there is a "Cancel" button, this is called when the |
77 // user presses the "Cancel" button or the Close button on the window or | 77 // user presses the "Cancel" button or the Close button on the window or |
78 // in the system menu, or presses the Esc key. This function should return | 78 // in the system menu, or presses the Esc key. This function should return |
79 // true if the window can be closed after it returns, or false if it must | 79 // true if the window can be closed after it returns, or false if it must |
80 // remain open. | 80 // remain open. |
81 virtual bool Cancel(); | 81 virtual bool Cancel(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual Widget* GetWidget() OVERRIDE; | 120 virtual Widget* GetWidget() OVERRIDE; |
121 virtual const Widget* GetWidget() const OVERRIDE; | 121 virtual const Widget* GetWidget() const OVERRIDE; |
122 | 122 |
123 private: | 123 private: |
124 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); | 124 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); |
125 }; | 125 }; |
126 | 126 |
127 } // namespace views | 127 } // namespace views |
128 | 128 |
129 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 129 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
OLD | NEW |