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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) { | 193 NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) { |
194 if (ShouldUseCustomFrame()) | 194 if (ShouldUseCustomFrame()) |
195 return CreateDialogFrameView(widget, gfx::Insets()); | 195 return CreateDialogFrameView(widget, gfx::Insets()); |
196 return WidgetDelegate::CreateNonClientFrameView(widget); | 196 return WidgetDelegate::CreateNonClientFrameView(widget); |
197 } | 197 } |
198 | 198 |
199 // static | 199 // static |
200 NonClientFrameView* DialogDelegate::CreateDialogFrameView( | 200 NonClientFrameView* DialogDelegate::CreateDialogFrameView( |
201 Widget* widget, | 201 Widget* widget, |
202 const gfx::Insets& content_margins) { | 202 const gfx::Insets& content_margins) { |
203 BubbleFrameView* frame = new BubbleFrameView( | 203 BubbleFrameView* frame = |
204 ViewsDelegate::GetInstance()->GetDialogFrameViewInsets(), | 204 new BubbleFrameView(ViewsDelegate::GetInstance()->GetInsetsMetric( |
205 content_margins); | 205 InsetsMetric::DIALOG_FRAME_VIEW), |
| 206 content_margins); |
206 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; | 207 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; |
207 std::unique_ptr<BubbleBorder> border( | 208 std::unique_ptr<BubbleBorder> border( |
208 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); | 209 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); |
209 border->set_use_theme_background_color(true); | 210 border->set_use_theme_background_color(true); |
210 frame->SetBubbleBorder(std::move(border)); | 211 frame->SetBubbleBorder(std::move(border)); |
211 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); | 212 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); |
212 if (delegate) | 213 if (delegate) |
213 frame->SetFootnoteView(delegate->CreateFootnoteView()); | 214 frame->SetFootnoteView(delegate->CreateFootnoteView()); |
214 return frame; | 215 return frame; |
215 } | 216 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 node_data->role = ui::AX_ROLE_DIALOG; | 262 node_data->role = ui::AX_ROLE_DIALOG; |
262 } | 263 } |
263 | 264 |
264 void DialogDelegateView::ViewHierarchyChanged( | 265 void DialogDelegateView::ViewHierarchyChanged( |
265 const ViewHierarchyChangedDetails& details) { | 266 const ViewHierarchyChangedDetails& details) { |
266 if (details.is_add && details.child == this && GetWidget()) | 267 if (details.is_add && details.child == this && GetWidget()) |
267 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 268 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
268 } | 269 } |
269 | 270 |
270 } // namespace views | 271 } // namespace views |
OLD | NEW |