Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: ui/views/bubble/bubble_dialog_delegate.cc

Issue 2880433002: views: don't snap dialogs with no buttons (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/base/default_style.h" 9 #include "ui/base/default_style.h"
10 #include "ui/base/material_design/material_design_controller.h" 10 #include "ui/base/material_design/material_design_controller.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Linux clips bubble windows that extend outside their parent window bounds. 80 // Linux clips bubble windows that extend outside their parent window bounds.
81 // Mac never adjusts. 81 // Mac never adjusts.
82 bubble_delegate->set_adjust_if_offscreen(false); 82 bubble_delegate->set_adjust_if_offscreen(false);
83 #endif 83 #endif
84 84
85 bubble_delegate->SizeToContents(); 85 bubble_delegate->SizeToContents();
86 bubble_widget->AddObserver(bubble_delegate); 86 bubble_widget->AddObserver(bubble_delegate);
87 return bubble_widget; 87 return bubble_widget;
88 } 88 }
89 89
90 bool BubbleDialogDelegateView::ShouldSnapFrameWidth() const {
91 return GetDialogButtons() != ui::DIALOG_BUTTON_NONE;
Peter Kasting 2017/05/10 20:41:24 Why do this in BubbleDialogDelegateView rather tha
Elly Fong-Jones 2017/05/10 21:06:49 Oops! It should definitely be on DialogDelegateVie
92 }
93
90 BubbleDialogDelegateView* BubbleDialogDelegateView::AsBubbleDialogDelegate() { 94 BubbleDialogDelegateView* BubbleDialogDelegateView::AsBubbleDialogDelegate() {
91 return this; 95 return this;
92 } 96 }
93 97
94 bool BubbleDialogDelegateView::ShouldShowCloseButton() const { 98 bool BubbleDialogDelegateView::ShouldShowCloseButton() const {
95 return false; 99 return false;
96 } 100 }
97 101
98 ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) { 102 ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) {
99 DialogClientView* client = new DialogClientView(widget, GetContentsView()); 103 DialogClientView* client = new DialogClientView(widget, GetContentsView());
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // http://crbug.com/474622 for details. 324 // http://crbug.com/474622 for details.
321 if (widget == GetWidget() && visible) { 325 if (widget == GetWidget() && visible) {
322 ui::AXNodeData node_data; 326 ui::AXNodeData node_data;
323 GetAccessibleNodeData(&node_data); 327 GetAccessibleNodeData(&node_data);
324 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) 328 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG)
325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 329 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
326 } 330 }
327 } 331 }
328 332
329 } // namespace views 333 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698