| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const DialogClientView* GetDialogClientView() const; | 105 const DialogClientView* GetDialogClientView() const; |
| 106 DialogClientView* GetDialogClientView(); | 106 DialogClientView* GetDialogClientView(); |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 // Overridden from WindowDelegate: | 109 // Overridden from WindowDelegate: |
| 110 virtual ui::AccessibilityTypes::Role GetAccessibleWindowRole() const OVERRIDE; | 110 virtual ui::AccessibilityTypes::Role GetAccessibleWindowRole() const OVERRIDE; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // A DialogDelegate implementation that is-a View. Used to override GetWidget() | 113 // A DialogDelegate implementation that is-a View. Used to override GetWidget() |
| 114 // to call View's GetWidget() for the common case where a DialogDelegate | 114 // to call View's GetWidget() for the common case where a DialogDelegate |
| 115 // implementation is-a View. | 115 // implementation is-a View. Note that DialogDelegateView is not owned by |
| 116 // view's hierarchy and is expected to be deleted on DeleteDelegate call. |
| 116 class VIEWS_EXPORT DialogDelegateView : public DialogDelegate, | 117 class VIEWS_EXPORT DialogDelegateView : public DialogDelegate, |
| 117 public View { | 118 public View { |
| 118 public: | 119 public: |
| 119 DialogDelegateView(); | 120 DialogDelegateView(); |
| 120 virtual ~DialogDelegateView(); | 121 virtual ~DialogDelegateView(); |
| 121 | 122 |
| 122 // Create a |dialog| window Widget with the specified |context| or |parent|. | 123 // Create a |dialog| window Widget with the specified |context| or |parent|. |
| 123 static Widget* CreateDialogWidget(DialogDelegateView* dialog, | 124 static Widget* CreateDialogWidget(DialogDelegateView* dialog, |
| 124 gfx::NativeWindow context, | 125 gfx::NativeWindow context, |
| 125 gfx::NativeWindow parent); | 126 gfx::NativeWindow parent); |
| 126 | 127 |
| 127 // Overridden from DialogDelegate: | 128 // Overridden from DialogDelegate: |
| 129 virtual void DeleteDelegate() OVERRIDE; |
| 128 virtual Widget* GetWidget() OVERRIDE; | 130 virtual Widget* GetWidget() OVERRIDE; |
| 129 virtual const Widget* GetWidget() const OVERRIDE; | 131 virtual const Widget* GetWidget() const OVERRIDE; |
| 130 virtual View* GetContentsView() OVERRIDE; | 132 virtual View* GetContentsView() OVERRIDE; |
| 131 | 133 |
| 132 private: | 134 private: |
| 133 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); | 135 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace views | 138 } // namespace views |
| 137 | 139 |
| 138 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ | 140 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ |
| OLD | NEW |