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" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "third_party/skia/include/core/SkRegion.h" | 14 #include "third_party/skia/include/core/SkRegion.h" |
15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
16 #include "ui/aura/client/capture_client.h" | 16 #include "ui/aura/client/capture_client.h" |
17 #include "ui/aura/client/cursor_client.h" | 17 #include "ui/aura/client/cursor_client.h" |
18 #include "ui/aura/client/focus_client.h" | 18 #include "ui/aura/client/focus_client.h" |
19 #include "ui/aura/client/screen_position_client.h" | 19 #include "ui/aura/client/screen_position_client.h" |
20 #include "ui/aura/client/window_tree_client.h" | 20 #include "ui/aura/client/window_parenting_client.h" |
21 #include "ui/aura/env.h" | 21 #include "ui/aura/env.h" |
22 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
23 #include "ui/aura/window_event_dispatcher.h" | 23 #include "ui/aura/window_event_dispatcher.h" |
24 #include "ui/aura/window_observer.h" | 24 #include "ui/aura/window_observer.h" |
25 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
26 #include "ui/base/dragdrop/os_exchange_data.h" | 26 #include "ui/base/dragdrop/os_exchange_data.h" |
27 #include "ui/base/ui_base_types.h" | 27 #include "ui/base/ui_base_types.h" |
28 #include "ui/compositor/layer.h" | 28 #include "ui/compositor/layer.h" |
29 #include "ui/display/display.h" | 29 #include "ui/display/display.h" |
30 #include "ui/display/screen.h" | 30 #include "ui/display/screen.h" |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 for (Widget::Widgets::iterator it = widgets.begin(); | 1164 for (Widget::Widgets::iterator it = widgets.begin(); |
1165 it != widgets.end(); ++it) { | 1165 it != widgets.end(); ++it) { |
1166 (*it)->NotifyNativeViewHierarchyWillChange(); | 1166 (*it)->NotifyNativeViewHierarchyWillChange(); |
1167 } | 1167 } |
1168 | 1168 |
1169 if (new_parent) { | 1169 if (new_parent) { |
1170 new_parent->AddChild(native_view); | 1170 new_parent->AddChild(native_view); |
1171 } else { | 1171 } else { |
1172 // The following looks weird, but it's the equivalent of what aura has | 1172 // The following looks weird, but it's the equivalent of what aura has |
1173 // always done. (The previous behaviour of aura::Window::SetParent() used | 1173 // always done. (The previous behaviour of aura::Window::SetParent() used |
1174 // NULL as a special value that meant ask the WindowTreeClient where things | 1174 // NULL as a special value that meant ask the WindowParentingClient where |
1175 // should go.) | 1175 // things should go.) |
1176 // | 1176 // |
1177 // This probably isn't strictly correct, but its an invariant that a Window | 1177 // This probably isn't strictly correct, but its an invariant that a Window |
1178 // in use will be attached to a RootWindow, so we can't just call | 1178 // in use will be attached to a RootWindow, so we can't just call |
1179 // RemoveChild here. The only possible thing that could assign a RootWindow | 1179 // RemoveChild here. The only possible thing that could assign a RootWindow |
1180 // in this case is the stacking client of the current RootWindow. This | 1180 // in this case is the stacking client of the current RootWindow. This |
1181 // matches our previous behaviour; the global stacking client would almost | 1181 // matches our previous behaviour; the global stacking client would almost |
1182 // always reattach the window to the same RootWindow. | 1182 // always reattach the window to the same RootWindow. |
1183 aura::Window* root_window = native_view->GetRootWindow(); | 1183 aura::Window* root_window = native_view->GetRootWindow(); |
1184 aura::client::ParentWindowWithContext( | 1184 aura::client::ParentWindowWithContext( |
1185 native_view, root_window, root_window->GetBoundsInScreen()); | 1185 native_view, root_window, root_window->GetBoundsInScreen()); |
(...skipping 29 matching lines...) Expand all Loading... |
1215 gfx::NativeView native_view) { | 1215 gfx::NativeView native_view) { |
1216 aura::client::CaptureClient* capture_client = | 1216 aura::client::CaptureClient* capture_client = |
1217 aura::client::GetCaptureClient(native_view->GetRootWindow()); | 1217 aura::client::GetCaptureClient(native_view->GetRootWindow()); |
1218 if (!capture_client) | 1218 if (!capture_client) |
1219 return nullptr; | 1219 return nullptr; |
1220 return capture_client->GetGlobalCaptureWindow(); | 1220 return capture_client->GetGlobalCaptureWindow(); |
1221 } | 1221 } |
1222 | 1222 |
1223 } // namespace internal | 1223 } // namespace internal |
1224 } // namespace views | 1224 } // namespace views |
OLD | NEW |