| 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_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 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "ui/base/accessibility/accessibility_types.h" | 10 #include "ui/base/accessibility/accessibility_types.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // row as the OK and CANCEL buttons but flush to the left and extending | 67 // row as the OK and CANCEL buttons but flush to the left and extending |
| 68 // up to the buttons. | 68 // up to the buttons. |
| 69 virtual View* GetExtraView(); | 69 virtual View* GetExtraView(); |
| 70 | 70 |
| 71 // Returns whether the height of the extra view should be at least as tall as | 71 // Returns whether the height of the extra view should be at least as tall as |
| 72 // the buttons. The default (false) is to give the extra view its preferred | 72 // the buttons. The default (false) is to give the extra view its preferred |
| 73 // height. By returning true the height becomes | 73 // height. By returning true the height becomes |
| 74 // max(extra_view preferred height, buttons preferred height). | 74 // max(extra_view preferred height, buttons preferred height). |
| 75 virtual bool GetSizeExtraViewHeightToButtons(); | 75 virtual bool GetSizeExtraViewHeightToButtons(); |
| 76 | 76 |
| 77 // For Dialog boxes, if there is a "Cancel" button, this is called when the | 77 // For Dialog boxes, if there is a "Cancel" button or no dialog button at all, |
| 78 // user presses the "Cancel" button or the Close button on the window or | 78 // this is called when the user presses the "Cancel" button or the Close |
| 79 // in the system menu, or presses the Esc key. This function should return | 79 // button on the window or in the system menu, or presses the Esc key. |
| 80 // true if the window can be closed after it returns, or false if it must | 80 // This function should return true if the window can be closed after it |
| 81 // remain open. | 81 // returns, or false if it must remain open. |
| 82 virtual bool Cancel(); | 82 virtual bool Cancel(); |
| 83 | 83 |
| 84 // For Dialog boxes, this is called when the user presses the "OK" button, | 84 // For Dialog boxes, this is called when the user presses the "OK" button, |
| 85 // or the Enter key. Can also be called on Esc key or close button | 85 // or the Enter key. Can also be called on Esc key or close button |
| 86 // presses if there is no "Cancel" button. This function should return | 86 // presses if there is no "Cancel" button. This function should return |
| 87 // true if the window can be closed after it returns, or false if it must | 87 // true if the window can be closed after it returns, or false if it must |
| 88 // remain open. If |window_closing| is true, it means that this handler is | 88 // remain open. If |window_closing| is true, it means that this handler is |
| 89 // being called because the window is being closed (e.g. by Window::Close) | 89 // being called because the window is being closed (e.g. by Window::Close) |
| 90 // and there is no Cancel handler, so Accept is being called instead. | 90 // and there is no Cancel handler, so Accept is being called instead. |
| 91 virtual bool Accept(bool window_closing); | 91 virtual bool Accept(bool window_closing); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 121 virtual Widget* GetWidget() OVERRIDE; | 121 virtual Widget* GetWidget() OVERRIDE; |
| 122 virtual const Widget* GetWidget() const OVERRIDE; | 122 virtual const Widget* GetWidget() const OVERRIDE; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); | 125 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace views | 128 } // namespace views |
| 129 | 129 |
| 130 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 130 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
| OLD | NEW |