| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bubble/bubble_dialog_delegate.h" | 5 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 BubbleDialogDelegateView* BubbleDialogDelegateView::AsBubbleDialogDelegate() { | 91 BubbleDialogDelegateView* BubbleDialogDelegateView::AsBubbleDialogDelegate() { |
| 92 return this; | 92 return this; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool BubbleDialogDelegateView::ShouldShowCloseButton() const { | 95 bool BubbleDialogDelegateView::ShouldShowCloseButton() const { |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 | 98 |
| 99 ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) { | 99 ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) { |
| 100 DialogClientView* client = new DialogClientView(widget, GetContentsView()); | 100 DialogClientView* client = new DialogClientView(widget, GetContentsView()); |
| 101 client->SetButtonRowInsets(gfx::Insets()); | 101 LayoutProvider* provider = LayoutProvider::Get(); |
| 102 // The other three sides are taken care of by the |margins_| given to |
| 103 // BubbleFrameView in CreateNonClientFrameView(). |
| 104 client->SetButtonRowInsets(gfx::Insets( |
| 105 provider->GetDistanceMetric(DISTANCE_BUBBLE_BUTTON_TOP_MARGIN), 0, 0, 0)); |
| 102 widget->non_client_view()->set_mirror_client_in_rtl(mirror_arrow_in_rtl_); | 106 widget->non_client_view()->set_mirror_client_in_rtl(mirror_arrow_in_rtl_); |
| 103 return client; | 107 return client; |
| 104 } | 108 } |
| 105 | 109 |
| 106 NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView( | 110 NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView( |
| 107 Widget* widget) { | 111 Widget* widget) { |
| 108 BubbleFrameView* frame = new BubbleFrameView(title_margins_, margins_); | 112 BubbleFrameView* frame = new BubbleFrameView(title_margins_, margins_); |
| 109 // Note: In CreateBubble, the call to SizeToContents() will cause | 113 // Note: In CreateBubble, the call to SizeToContents() will cause |
| 110 // the relayout that this call requires. | 114 // the relayout that this call requires. |
| 111 frame->SetTitleFontList(GetTitleFontList()); | 115 frame->SetTitleFontList(GetTitleFontList()); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // http://crbug.com/474622 for details. | 321 // http://crbug.com/474622 for details. |
| 318 if (widget == GetWidget() && visible) { | 322 if (widget == GetWidget() && visible) { |
| 319 ui::AXNodeData node_data; | 323 ui::AXNodeData node_data; |
| 320 GetAccessibleNodeData(&node_data); | 324 GetAccessibleNodeData(&node_data); |
| 321 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) | 325 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) |
| 322 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 326 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 323 } | 327 } |
| 324 } | 328 } |
| 325 | 329 |
| 326 } // namespace views | 330 } // namespace views |
| OLD | NEW |