| 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 VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 5 #ifndef VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
| 6 #define VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 6 #define VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/accessibility/accessibility_types.h" | 9 #include "ui/base/accessibility/accessibility_types.h" |
| 10 #include "ui/base/message_box_flags.h" | 10 #include "ui/base/message_box_flags.h" |
| 11 #include "views/widget/widget_delegate.h" | 11 #include "views/widget/widget_delegate.h" |
| 12 #include "views/window/dialog_client_view.h" | 12 #include "views/window/dialog_client_view.h" |
| 13 | 13 |
| 14 using ui::MessageBoxFlags; | 14 using ui::MessageBoxFlags; |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 | 17 |
| 18 class View; | 18 class View; |
| 19 | 19 |
| 20 /////////////////////////////////////////////////////////////////////////////// | 20 /////////////////////////////////////////////////////////////////////////////// |
| 21 // | 21 // |
| 22 // DialogDelegate | 22 // DialogDelegate |
| 23 // | 23 // |
| 24 // DialogDelegate is an interface implemented by objects that wish to show a | 24 // DialogDelegate is an interface implemented by objects that wish to show a |
| 25 // dialog box Window. The window that is displayed uses this interface to | 25 // dialog box Window. The window that is displayed uses this interface to |
| 26 // determine how it should be displayed and notify the delegate object of | 26 // determine how it should be displayed and notify the delegate object of |
| 27 // certain events. | 27 // certain events. |
| 28 // | 28 // |
| 29 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
| 30 class VIEWS_API DialogDelegate : public WidgetDelegate { | 30 class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { |
| 31 public: | 31 public: |
| 32 virtual DialogDelegate* AsDialogDelegate(); | 32 virtual DialogDelegate* AsDialogDelegate(); |
| 33 | 33 |
| 34 // Returns a mask specifying which of the available DialogButtons are visible | 34 // Returns a mask specifying which of the available DialogButtons are visible |
| 35 // for the dialog. Note: If an OK button is provided, you should provide a | 35 // for the dialog. Note: If an OK button is provided, you should provide a |
| 36 // CANCEL button. A dialog box with just an OK button is frowned upon and | 36 // CANCEL button. A dialog box with just an OK button is frowned upon and |
| 37 // considered a very special case, so if you're planning on including one, | 37 // considered a very special case, so if you're planning on including one, |
| 38 // you should reconsider, or beng says there will be stabbings. | 38 // you should reconsider, or beng says there will be stabbings. |
| 39 // | 39 // |
| 40 // To use the extra button you need to override GetDialogButtons() | 40 // To use the extra button you need to override GetDialogButtons() |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 DialogClientView* GetDialogClientView(); | 108 DialogClientView* GetDialogClientView(); |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 // Overridden from WindowDelegate: | 111 // Overridden from WindowDelegate: |
| 112 virtual ui::AccessibilityTypes::Role GetAccessibleWindowRole() const OVERRIDE; | 112 virtual ui::AccessibilityTypes::Role GetAccessibleWindowRole() const OVERRIDE; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 // A DialogDelegate implementation that is-a View. Used to override GetWidget() | 115 // A DialogDelegate implementation that is-a View. Used to override GetWidget() |
| 116 // to call View's GetWidget() for the common case where a DialogDelegate | 116 // to call View's GetWidget() for the common case where a DialogDelegate |
| 117 // implementation is-a View. | 117 // implementation is-a View. |
| 118 class VIEWS_API DialogDelegateView : public DialogDelegate, | 118 class VIEWS_EXPORT DialogDelegateView : public DialogDelegate, |
| 119 public View { | 119 public View { |
| 120 public: | 120 public: |
| 121 DialogDelegateView(); | 121 DialogDelegateView(); |
| 122 virtual ~DialogDelegateView(); | 122 virtual ~DialogDelegateView(); |
| 123 | 123 |
| 124 // Overridden from DialogDelegate: | 124 // Overridden from DialogDelegate: |
| 125 virtual Widget* GetWidget() OVERRIDE; | 125 virtual Widget* GetWidget() OVERRIDE; |
| 126 virtual const Widget* GetWidget() const OVERRIDE; | 126 virtual const Widget* GetWidget() const OVERRIDE; |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); | 129 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 | 132 |
| 133 } // namespace views | 133 } // namespace views |
| 134 | 134 |
| 135 #endif // VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 135 #endif // VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
| OLD | NEW |