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/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 #include "ui/views/views_delegate.h" | 41 #include "ui/views/views_delegate.h" |
42 #include "ui/views/widget/drop_helper.h" | 42 #include "ui/views/widget/drop_helper.h" |
43 #include "ui/views/widget/focus_manager_event_handler.h" | 43 #include "ui/views/widget/focus_manager_event_handler.h" |
44 #include "ui/views/widget/native_widget_delegate.h" | 44 #include "ui/views/widget/native_widget_delegate.h" |
45 #include "ui/views/widget/root_view.h" | 45 #include "ui/views/widget/root_view.h" |
46 #include "ui/views/widget/tooltip_manager_aura.h" | 46 #include "ui/views/widget/tooltip_manager_aura.h" |
47 #include "ui/views/widget/widget_aura_utils.h" | 47 #include "ui/views/widget/widget_aura_utils.h" |
48 #include "ui/views/widget/widget_delegate.h" | 48 #include "ui/views/widget/widget_delegate.h" |
49 #include "ui/views/widget/window_reorderer.h" | 49 #include "ui/views/widget/window_reorderer.h" |
50 #include "ui/wm/core/shadow_types.h" | 50 #include "ui/wm/core/shadow_types.h" |
51 #include "ui/wm/core/transient_window_manager.h" | |
51 #include "ui/wm/core/window_animations.h" | 52 #include "ui/wm/core/window_animations.h" |
52 #include "ui/wm/core/window_util.h" | 53 #include "ui/wm/core/window_util.h" |
53 #include "ui/wm/public/activation_client.h" | 54 #include "ui/wm/public/activation_client.h" |
54 #include "ui/wm/public/window_move_client.h" | 55 #include "ui/wm/public/window_move_client.h" |
55 #include "ui/wm/public/window_types.h" | 56 #include "ui/wm/public/window_types.h" |
56 | 57 |
57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
58 #include "base/win/scoped_gdi_object.h" | 59 #include "base/win/scoped_gdi_object.h" |
59 #include "base/win/win_util.h" | 60 #include "base/win/win_util.h" |
60 #include "ui/base/l10n/l10n_util_win.h" | 61 #include "ui/base/l10n/l10n_util_win.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 gfx::NativeView parent = params.parent; | 175 gfx::NativeView parent = params.parent; |
175 gfx::NativeView context = params.context; | 176 gfx::NativeView context = params.context; |
176 if (!params.child) { | 177 if (!params.child) { |
177 // Set up the transient child before the window is added. This way the | 178 // Set up the transient child before the window is added. This way the |
178 // LayoutManager knows the window has a transient parent. | 179 // LayoutManager knows the window has a transient parent. |
179 if (parent && parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN) { | 180 if (parent && parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN) { |
180 wm::AddTransientChild(parent, window_); | 181 wm::AddTransientChild(parent, window_); |
181 if (!context) | 182 if (!context) |
182 context = parent; | 183 context = parent; |
183 parent = NULL; | 184 parent = NULL; |
185 | |
186 if (params.type == Widget::InitParams::TYPE_BUBBLE) { | |
sky
2017/05/05 23:23:19
This is very subtle and worth a comment.
Qiang(Joe) Xu
2017/05/06 00:12:22
Done.
| |
187 wm::TransientWindowManager::Get(window_) | |
188 ->set_parent_controls_visibility(true); | |
189 } | |
184 } | 190 } |
185 // SetAlwaysOnTop before SetParent so that always-on-top container is used. | 191 // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
186 SetAlwaysOnTop(params.keep_on_top); | 192 SetAlwaysOnTop(params.keep_on_top); |
187 // Make sure we have a real |window_bounds|. | 193 // Make sure we have a real |window_bounds|. |
188 if (parent && window_bounds == gfx::Rect()) { | 194 if (parent && window_bounds == gfx::Rect()) { |
189 // If a parent is specified but no bounds are given, | 195 // If a parent is specified but no bounds are given, |
190 // use the origin of the parent's display so that the widget | 196 // use the origin of the parent's display so that the widget |
191 // will be added to the same display as the parent. | 197 // will be added to the same display as the parent. |
192 gfx::Rect bounds = display::Screen::GetScreen() | 198 gfx::Rect bounds = display::Screen::GetScreen() |
193 ->GetDisplayNearestWindow(parent) | 199 ->GetDisplayNearestWindow(parent) |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1189 gfx::NativeView native_view) { | 1195 gfx::NativeView native_view) { |
1190 aura::client::CaptureClient* capture_client = | 1196 aura::client::CaptureClient* capture_client = |
1191 aura::client::GetCaptureClient(native_view->GetRootWindow()); | 1197 aura::client::GetCaptureClient(native_view->GetRootWindow()); |
1192 if (!capture_client) | 1198 if (!capture_client) |
1193 return nullptr; | 1199 return nullptr; |
1194 return capture_client->GetGlobalCaptureWindow(); | 1200 return capture_client->GetGlobalCaptureWindow(); |
1195 } | 1201 } |
1196 | 1202 |
1197 } // namespace internal | 1203 } // namespace internal |
1198 } // namespace views | 1204 } // namespace views |
OLD | NEW |