| 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 22 matching lines...) Expand all Loading... |
| 33 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; | 33 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; |
| 34 bubble_params.accept_events = bubble->accept_events(); | 34 bubble_params.accept_events = bubble->accept_events(); |
| 35 if (bubble->parent_window()) | 35 if (bubble->parent_window()) |
| 36 bubble_params.parent = bubble->parent_window(); | 36 bubble_params.parent = bubble->parent_window(); |
| 37 else if (bubble->anchor_widget()) | 37 else if (bubble->anchor_widget()) |
| 38 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); | 38 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); |
| 39 bubble_params.activatable = bubble->CanActivate() ? | 39 bubble_params.activatable = bubble->CanActivate() ? |
| 40 Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO; | 40 Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO; |
| 41 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); | 41 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); |
| 42 bubble_widget->Init(bubble_params); | 42 bubble_widget->Init(bubble_params); |
| 43 if (bubble_params.parent) |
| 44 bubble_widget->StackAbove(bubble_params.parent); |
| 43 return bubble_widget; | 45 return bubble_widget; |
| 44 } | 46 } |
| 45 | 47 |
| 46 } // namespace | 48 } // namespace |
| 47 | 49 |
| 48 // static | 50 // static |
| 49 const char BubbleDelegateView::kViewClassName[] = "BubbleDelegateView"; | 51 const char BubbleDelegateView::kViewClassName[] = "BubbleDelegateView"; |
| 50 | 52 |
| 51 BubbleDelegateView::BubbleDelegateView() | 53 BubbleDelegateView::BubbleDelegateView() |
| 52 : close_on_esc_(true), | 54 : close_on_esc_(true), |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // http://crbug.com/474622 for details. | 314 // http://crbug.com/474622 for details. |
| 313 if (widget == GetWidget() && visible) { | 315 if (widget == GetWidget() && visible) { |
| 314 ui::AXViewState state; | 316 ui::AXViewState state; |
| 315 GetAccessibleState(&state); | 317 GetAccessibleState(&state); |
| 316 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 318 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
| 317 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 319 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 318 } | 320 } |
| 319 } | 321 } |
| 320 | 322 |
| 321 } // namespace views | 323 } // namespace views |
| OLD | NEW |