| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const char* BubbleDelegateView::GetClassName() const { | 137 const char* BubbleDelegateView::GetClassName() const { |
| 138 return kViewClassName; | 138 return kViewClassName; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { | 141 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { |
| 142 DCHECK(GetBubbleFrameView()); | 142 DCHECK(GetBubbleFrameView()); |
| 143 if (widget == GetWidget() && close_reason_ == CloseReason::UNKNOWN && | 143 if (widget == GetWidget() && close_reason_ == CloseReason::UNKNOWN && |
| 144 GetBubbleFrameView()->close_button_clicked()) { | 144 GetBubbleFrameView()->close_button_clicked()) { |
| 145 close_reason_ = CloseReason::CLOSE_BUTTON; | 145 close_reason_ = CloseReason::CLOSE_BUTTON; |
| 146 } | 146 } |
| 147 View* anchor_view = GetAnchorView(); |
| 148 if (anchor_view) |
| 149 anchor_view->OnBubbleClosing(); |
| 147 } | 150 } |
| 148 | 151 |
| 149 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) { | 152 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) { |
| 150 if (anchor_widget() == widget) | 153 if (anchor_widget() == widget) |
| 151 SetAnchorView(NULL); | 154 SetAnchorView(NULL); |
| 152 } | 155 } |
| 153 | 156 |
| 154 void BubbleDelegateView::OnWidgetVisibilityChanging(Widget* widget, | 157 void BubbleDelegateView::OnWidgetVisibilityChanging(Widget* widget, |
| 155 bool visible) { | 158 bool visible) { |
| 156 #if defined(OS_WIN) | 159 #if defined(OS_WIN) |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // http://crbug.com/474622 for details. | 317 // http://crbug.com/474622 for details. |
| 315 if (widget == GetWidget() && visible) { | 318 if (widget == GetWidget() && visible) { |
| 316 ui::AXViewState state; | 319 ui::AXViewState state; |
| 317 GetAccessibleState(&state); | 320 GetAccessibleState(&state); |
| 318 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 321 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
| 319 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 322 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 320 } | 323 } |
| 321 } | 324 } |
| 322 | 325 |
| 323 } // namespace views | 326 } // namespace views |
| OLD | NEW |