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

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

Issue 1067113002: Reland: Add an event to notify accessibility when a permissions bubble gets shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise/relocate comment Created 5 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 | « chrome/browser/ui/views/website_settings/permissions_bubble_view.cc ('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 (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/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/color_utils.h" 9 #include "ui/gfx/color_utils.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 298 }
299 299
300 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { 300 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) {
301 if (widget == GetWidget() && anchor_widget() && 301 if (widget == GetWidget() && anchor_widget() &&
302 anchor_widget()->GetTopLevelWidget()) { 302 anchor_widget()->GetTopLevelWidget()) {
303 if (visible) 303 if (visible)
304 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 304 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
305 else 305 else
306 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 306 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
307 } 307 }
308
309 // Fire AX_EVENT_ALERT for bubbles marked as AX_ROLE_ALERT_DIALOG; this
310 // instructs accessibility tools to read the bubble in its entirety rather
311 // than just its title and initially focused view. See
312 // http://crbug.com/474622 for details.
313 if (widget == GetWidget() && visible) {
314 ui::AXViewState state;
315 GetAccessibleState(&state);
316 if (state.role == ui::AX_ROLE_ALERT_DIALOG)
317 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
318 }
308 } 319 }
309 320
310 } // namespace views 321 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/website_settings/permissions_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698