| OLD | NEW |
| 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_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 bubble_params.delegate = bubble; | 34 bubble_params.delegate = bubble; |
| 35 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; | 35 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; |
| 36 bubble_params.accept_events = bubble->accept_events(); | 36 bubble_params.accept_events = bubble->accept_events(); |
| 37 if (bubble->parent_window()) | 37 if (bubble->parent_window()) |
| 38 bubble_params.parent = bubble->parent_window(); | 38 bubble_params.parent = bubble->parent_window(); |
| 39 else if (bubble->anchor_widget()) | 39 else if (bubble->anchor_widget()) |
| 40 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); | 40 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); |
| 41 bubble_params.activatable = bubble->CanActivate() | 41 bubble_params.activatable = bubble->CanActivate() |
| 42 ? Widget::InitParams::ACTIVATABLE_YES | 42 ? Widget::InitParams::ACTIVATABLE_YES |
| 43 : Widget::InitParams::ACTIVATABLE_NO; | 43 : Widget::InitParams::ACTIVATABLE_NO; |
| 44 bubble_params.pass_accelerator_to_parent = true; |
| 44 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); | 45 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); |
| 45 bubble_widget->Init(bubble_params); | 46 bubble_widget->Init(bubble_params); |
| 46 if (bubble_params.parent) | 47 if (bubble_params.parent) |
| 47 bubble_widget->StackAbove(bubble_params.parent); | 48 bubble_widget->StackAbove(bubble_params.parent); |
| 48 return bubble_widget; | 49 return bubble_widget; |
| 49 } | 50 } |
| 50 | 51 |
| 51 } // namespace | 52 } // namespace |
| 52 | 53 |
| 53 // static | 54 // static |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // http://crbug.com/474622 for details. | 321 // http://crbug.com/474622 for details. |
| 321 if (widget == GetWidget() && visible) { | 322 if (widget == GetWidget() && visible) { |
| 322 ui::AXNodeData node_data; | 323 ui::AXNodeData node_data; |
| 323 GetAccessibleNodeData(&node_data); | 324 GetAccessibleNodeData(&node_data); |
| 324 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) | 325 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) |
| 325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 326 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 326 } | 327 } |
| 327 } | 328 } |
| 328 | 329 |
| 329 } // namespace views | 330 } // namespace views |
| OLD | NEW |