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

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

Issue 2604793002: Allow Widget to pass accelerator handling to its parent.
Patch Set: Created 3 years, 12 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698