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 #include "ui/views/window/dialog_delegate.h" | 5 #include "ui/views/window/dialog_delegate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 bool DialogDelegate::GetExtraViewPadding(int* padding) { | 93 bool DialogDelegate::GetExtraViewPadding(int* padding) { |
94 return false; | 94 return false; |
95 } | 95 } |
96 | 96 |
97 View* DialogDelegate::CreateTitlebarExtraView() { | 97 View* DialogDelegate::CreateTitlebarExtraView() { |
98 return NULL; | 98 return NULL; |
99 } | 99 } |
100 | 100 |
101 View* DialogDelegate::CreateFootnoteView() { | 101 scoped_ptr<View> DialogDelegate::CreateFootnoteView() { |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
104 | 104 |
105 bool DialogDelegate::Cancel() { | 105 bool DialogDelegate::Cancel() { |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 bool DialogDelegate::Accept(bool window_closing) { | 109 bool DialogDelegate::Accept(bool window_closing) { |
110 return Accept(); | 110 return Accept(); |
111 } | 111 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 gfx::Insets()); | 202 gfx::Insets()); |
203 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; | 203 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; |
204 scoped_ptr<BubbleBorder> border( | 204 scoped_ptr<BubbleBorder> border( |
205 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); | 205 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); |
206 border->set_use_theme_background_color(true); | 206 border->set_use_theme_background_color(true); |
207 frame->SetBubbleBorder(std::move(border)); | 207 frame->SetBubbleBorder(std::move(border)); |
208 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); | 208 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); |
209 if (delegate) { | 209 if (delegate) { |
210 frame->SetTitlebarExtraView( | 210 frame->SetTitlebarExtraView( |
211 make_scoped_ptr(delegate->CreateTitlebarExtraView())); | 211 make_scoped_ptr(delegate->CreateTitlebarExtraView())); |
| 212 frame->SetFootnoteView(delegate->CreateFootnoteView()); |
212 } | 213 } |
213 return frame; | 214 return frame; |
214 } | 215 } |
215 | 216 |
216 bool DialogDelegate::UseNewStyleForThisDialog() const { | 217 bool DialogDelegate::UseNewStyleForThisDialog() const { |
217 return supports_new_style_; | 218 return supports_new_style_; |
218 } | 219 } |
219 | 220 |
220 const DialogClientView* DialogDelegate::GetDialogClientView() const { | 221 const DialogClientView* DialogDelegate::GetDialogClientView() const { |
221 return GetWidget()->client_view()->AsDialogClientView(); | 222 return GetWidget()->client_view()->AsDialogClientView(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 state->role = ui::AX_ROLE_DIALOG; | 261 state->role = ui::AX_ROLE_DIALOG; |
261 } | 262 } |
262 | 263 |
263 void DialogDelegateView::ViewHierarchyChanged( | 264 void DialogDelegateView::ViewHierarchyChanged( |
264 const ViewHierarchyChangedDetails& details) { | 265 const ViewHierarchyChangedDetails& details) { |
265 if (details.is_add && details.child == this && GetWidget()) | 266 if (details.is_add && details.child == this && GetWidget()) |
266 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 267 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
267 } | 268 } |
268 | 269 |
269 } // namespace views | 270 } // namespace views |
OLD | NEW |