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) | 43 if (bubble_params.parent) { |
44 bubble_widget->StackAbove(bubble_params.parent); | 44 // If the parent is active, let the bubble become a top-most window. |
45 // Otherwise, place it above the parent so other top level windows aren't | |
46 // overlapped. | |
47 Widget* parent = Widget::GetWidgetForNativeView(bubble_params.parent); | |
sky
2015/06/30 16:43:13
Why do we need to special case this? Shouldn't we
vasilii
2015/06/30 18:57:03
The original bug http://crbug.com/486730 was that
sky
2015/06/30 22:07:54
My question is why it matters. Won't the same thin
vasilii
2015/07/01 09:29:40
No, just watch the video from http://crbug.com/504
sky
2015/07/01 16:35:17
Sorry, but you're still not explaining why this co
vasilii
2015/07/02 09:12:52
The user opened a profile chooser. Then he opens t
| |
48 if (parent && !parent->IsActive()) | |
49 bubble_widget->StackAbove(bubble_params.parent); | |
50 } | |
45 return bubble_widget; | 51 return bubble_widget; |
46 } | 52 } |
47 | 53 |
48 } // namespace | 54 } // namespace |
49 | 55 |
50 // static | 56 // static |
51 const char BubbleDelegateView::kViewClassName[] = "BubbleDelegateView"; | 57 const char BubbleDelegateView::kViewClassName[] = "BubbleDelegateView"; |
52 | 58 |
53 BubbleDelegateView::BubbleDelegateView() | 59 BubbleDelegateView::BubbleDelegateView() |
54 : close_on_esc_(true), | 60 : close_on_esc_(true), |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 // http://crbug.com/474622 for details. | 320 // http://crbug.com/474622 for details. |
315 if (widget == GetWidget() && visible) { | 321 if (widget == GetWidget() && visible) { |
316 ui::AXViewState state; | 322 ui::AXViewState state; |
317 GetAccessibleState(&state); | 323 GetAccessibleState(&state); |
318 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 324 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
319 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
320 } | 326 } |
321 } | 327 } |
322 | 328 |
323 } // namespace views | 329 } // namespace views |
OLD | NEW |