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/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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); | 293 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); |
294 set_background(Background::CreateSolidBackground(color())); | 294 set_background(Background::CreateSolidBackground(color())); |
295 BubbleFrameView* frame_view = GetBubbleFrameView(); | 295 BubbleFrameView* frame_view = GetBubbleFrameView(); |
296 if (frame_view) | 296 if (frame_view) |
297 frame_view->bubble_border()->set_background_color(color()); | 297 frame_view->bubble_border()->set_background_color(color()); |
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 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
msw
2015/04/06 17:30:19
Most bubbles should have an anchor, but I suspect
David Tseng
2015/04/06 17:36:05
Done.
| |
306 } else { | |
306 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); | 307 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); |
308 } | |
307 } | 309 } |
308 } | 310 } |
309 | 311 |
310 } // namespace views | 312 } // namespace views |
OLD | NEW |