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