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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
12 #include "ui/aura/client/cursor_client.h" | 12 #include "ui/aura/client/cursor_client.h" |
13 #include "ui/aura/client/drag_drop_client.h" | 13 #include "ui/aura/client/drag_drop_client.h" |
14 #include "ui/aura/client/focus_client.h" | 14 #include "ui/aura/client/focus_client.h" |
15 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
16 #include "ui/aura/client/window_move_client.h" | 16 #include "ui/aura/client/window_move_client.h" |
17 #include "ui/aura/client/window_tree_client.h" | 17 #include "ui/aura/client/window_tree_client.h" |
18 #include "ui/aura/client/window_types.h" | |
19 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
20 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
21 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
22 #include "ui/aura/window_observer.h" | 21 #include "ui/aura/window_observer.h" |
23 #include "ui/base/dragdrop/os_exchange_data.h" | 22 #include "ui/base/dragdrop/os_exchange_data.h" |
24 #include "ui/base/ui_base_types.h" | 23 #include "ui/base/ui_base_types.h" |
25 #include "ui/compositor/layer.h" | 24 #include "ui/compositor/layer.h" |
26 #include "ui/events/event.h" | 25 #include "ui/events/event.h" |
27 #include "ui/gfx/canvas.h" | 26 #include "ui/gfx/canvas.h" |
28 #include "ui/gfx/font.h" | 27 #include "ui/gfx/font.h" |
29 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
30 #include "ui/native_theme/native_theme_aura.h" | 29 #include "ui/native_theme/native_theme_aura.h" |
31 #include "ui/views/drag_utils.h" | 30 #include "ui/views/drag_utils.h" |
32 #include "ui/views/ime/input_method_bridge.h" | 31 #include "ui/views/ime/input_method_bridge.h" |
33 #include "ui/views/views_delegate.h" | 32 #include "ui/views/views_delegate.h" |
34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 33 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
35 #include "ui/views/widget/drop_helper.h" | 34 #include "ui/views/widget/drop_helper.h" |
36 #include "ui/views/widget/native_widget_delegate.h" | 35 #include "ui/views/widget/native_widget_delegate.h" |
37 #include "ui/views/widget/root_view.h" | 36 #include "ui/views/widget/root_view.h" |
38 #include "ui/views/widget/tooltip_manager_aura.h" | 37 #include "ui/views/widget/tooltip_manager_aura.h" |
39 #include "ui/views/widget/widget_aura_utils.h" | 38 #include "ui/views/widget/widget_aura_utils.h" |
40 #include "ui/views/widget/widget_delegate.h" | 39 #include "ui/views/widget/widget_delegate.h" |
41 #include "ui/views/widget/window_reorderer.h" | 40 #include "ui/views/widget/window_reorderer.h" |
| 41 #include "ui/wm/public/window_types.h" |
42 | 42 |
43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
44 #include "base/win/scoped_gdi_object.h" | 44 #include "base/win/scoped_gdi_object.h" |
45 #include "base/win/win_util.h" | 45 #include "base/win/win_util.h" |
46 #include "ui/base/l10n/l10n_util_win.h" | 46 #include "ui/base/l10n/l10n_util_win.h" |
47 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" | 47 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
48 #endif | 48 #endif |
49 | 49 |
50 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 50 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
51 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" | 51 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 window_->Show(); | 123 window_->Show(); |
124 | 124 |
125 delegate_->OnNativeWidgetCreated(false); | 125 delegate_->OnNativeWidgetCreated(false); |
126 | 126 |
127 gfx::Rect window_bounds = params.bounds; | 127 gfx::Rect window_bounds = params.bounds; |
128 gfx::NativeView parent = params.parent; | 128 gfx::NativeView parent = params.parent; |
129 gfx::NativeView context = params.context; | 129 gfx::NativeView context = params.context; |
130 if (!params.child) { | 130 if (!params.child) { |
131 // Set up the transient child before the window is added. This way the | 131 // Set up the transient child before the window is added. This way the |
132 // LayoutManager knows the window has a transient parent. | 132 // LayoutManager knows the window has a transient parent. |
133 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { | 133 if (parent && parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN) { |
134 parent->AddTransientChild(window_); | 134 parent->AddTransientChild(window_); |
135 if (!context) | 135 if (!context) |
136 context = parent; | 136 context = parent; |
137 parent = NULL; | 137 parent = NULL; |
138 } | 138 } |
139 // SetAlwaysOnTop before SetParent so that always-on-top container is used. | 139 // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
140 SetAlwaysOnTop(params.keep_on_top); | 140 SetAlwaysOnTop(params.keep_on_top); |
141 // Make sure we have a real |window_bounds|. | 141 // Make sure we have a real |window_bounds|. |
142 if (parent && window_bounds == gfx::Rect()) { | 142 if (parent && window_bounds == gfx::Rect()) { |
143 // If a parent is specified but no bounds are given, | 143 // If a parent is specified but no bounds are given, |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 return aura::Env::GetInstance()->IsMouseButtonDown(); | 1143 return aura::Env::GetInstance()->IsMouseButtonDown(); |
1144 } | 1144 } |
1145 | 1145 |
1146 // static | 1146 // static |
1147 bool NativeWidgetPrivate::IsTouchDown() { | 1147 bool NativeWidgetPrivate::IsTouchDown() { |
1148 return aura::Env::GetInstance()->is_touch_down(); | 1148 return aura::Env::GetInstance()->is_touch_down(); |
1149 } | 1149 } |
1150 | 1150 |
1151 } // namespace internal | 1151 } // namespace internal |
1152 } // namespace views | 1152 } // namespace views |
OLD | NEW |