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

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

Issue 1919213002: Share DialogDelegateView:: and BubbleDialogDelegateView::'s impls of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_view_state.h" 8 #include "ui/accessibility/ax_view_state.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/color_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 frame->SetFootnoteView(CreateFootnoteView()); 108 frame->SetFootnoteView(CreateFootnoteView());
109 109
110 BubbleBorder::Arrow adjusted_arrow = arrow(); 110 BubbleBorder::Arrow adjusted_arrow = arrow();
111 if (base::i18n::IsRTL()) 111 if (base::i18n::IsRTL())
112 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); 112 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow);
113 frame->SetBubbleBorder(std::unique_ptr<BubbleBorder>( 113 frame->SetBubbleBorder(std::unique_ptr<BubbleBorder>(
114 new BubbleBorder(adjusted_arrow, shadow(), color()))); 114 new BubbleBorder(adjusted_arrow, shadow(), color())));
115 return frame; 115 return frame;
116 } 116 }
117 117
118 void BubbleDialogDelegateView::GetAccessibleState(ui::AXViewState* state) {
119 state->role = ui::AX_ROLE_DIALOG;
120 }
121
122 const char* BubbleDialogDelegateView::GetClassName() const { 118 const char* BubbleDialogDelegateView::GetClassName() const {
123 return kViewClassName; 119 return kViewClassName;
124 } 120 }
125 121
126 void BubbleDialogDelegateView::OnWidgetDestroying(Widget* widget) { 122 void BubbleDialogDelegateView::OnWidgetDestroying(Widget* widget) {
127 if (anchor_widget() == widget) 123 if (anchor_widget() == widget)
128 SetAnchorView(NULL); 124 SetAnchorView(NULL);
129 } 125 }
130 126
131 void BubbleDialogDelegateView::OnWidgetVisibilityChanging(Widget* widget, 127 void BubbleDialogDelegateView::OnWidgetVisibilityChanging(Widget* widget,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // http://crbug.com/474622 for details. 306 // http://crbug.com/474622 for details.
311 if (widget == GetWidget() && visible) { 307 if (widget == GetWidget() && visible) {
312 ui::AXViewState state; 308 ui::AXViewState state;
313 GetAccessibleState(&state); 309 GetAccessibleState(&state);
314 if (state.role == ui::AX_ROLE_ALERT_DIALOG) 310 if (state.role == ui::AX_ROLE_ALERT_DIALOG)
315 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 311 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
316 } 312 }
317 } 313 }
318 314
319 } // namespace views 315 } // 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