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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 2632543003: Refactor and push window properties up to class properties. (Closed)
Patch Set: Created 3 years, 11 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 (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 "services/ui/public/interfaces/window_manager.mojom.h" 14 #include "services/ui/public/interfaces/window_manager.mojom.h"
15 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 15 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
16 #include "third_party/skia/include/core/SkRegion.h" 16 #include "third_party/skia/include/core/SkRegion.h"
17 #include "ui/aura/client/aura_constants.h" 17 #include "ui/aura/client/aura_constants.h"
18 #include "ui/aura/client/capture_client.h" 18 #include "ui/aura/client/capture_client.h"
19 #include "ui/aura/client/cursor_client.h" 19 #include "ui/aura/client/cursor_client.h"
20 #include "ui/aura/client/drag_drop_client.h" 20 #include "ui/aura/client/drag_drop_client.h"
21 #include "ui/aura/client/focus_client.h" 21 #include "ui/aura/client/focus_client.h"
22 #include "ui/aura/client/screen_position_client.h" 22 #include "ui/aura/client/screen_position_client.h"
23 #include "ui/aura/client/window_parenting_client.h" 23 #include "ui/aura/client/window_parenting_client.h"
24 #include "ui/aura/env.h" 24 #include "ui/aura/env.h"
25 #include "ui/aura/mus/property_utils.h" 25 #include "ui/aura/mus/property_utils.h"
26 #include "ui/aura/window.h" 26 #include "ui/aura/window.h"
27 #include "ui/aura/window_event_dispatcher.h" 27 #include "ui/aura/window_event_dispatcher.h"
28 #include "ui/aura/window_observer.h" 28 #include "ui/aura/window_observer.h"
29 #include "ui/aura/window_property.h"
30 #include "ui/aura/window_tree_host.h" 29 #include "ui/aura/window_tree_host.h"
30 #include "ui/base/class_property.h"
31 #include "ui/base/dragdrop/os_exchange_data.h" 31 #include "ui/base/dragdrop/os_exchange_data.h"
32 #include "ui/base/ui_base_types.h" 32 #include "ui/base/ui_base_types.h"
33 #include "ui/compositor/layer.h" 33 #include "ui/compositor/layer.h"
34 #include "ui/display/display.h" 34 #include "ui/display/display.h"
35 #include "ui/display/screen.h" 35 #include "ui/display/screen.h"
36 #include "ui/events/event.h" 36 #include "ui/events/event.h"
37 #include "ui/gfx/canvas.h" 37 #include "ui/gfx/canvas.h"
38 #include "ui/gfx/font_list.h" 38 #include "ui/gfx/font_list.h"
39 #include "ui/native_theme/native_theme_aura.h" 39 #include "ui/native_theme/native_theme_aura.h"
40 #include "ui/views/drag_utils.h" 40 #include "ui/views/drag_utils.h"
(...skipping 23 matching lines...) Expand all
64 #if defined(USE_X11) && !defined(OS_CHROMEOS) 64 #if defined(USE_X11) && !defined(OS_CHROMEOS)
65 #include "ui/views/linux_ui/linux_ui.h" 65 #include "ui/views/linux_ui/linux_ui.h"
66 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 66 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
67 #endif 67 #endif
68 68
69 #if !defined(OS_CHROMEOS) 69 #if !defined(OS_CHROMEOS)
70 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 70 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
71 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" 71 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
72 #endif 72 #endif
73 73
74 DECLARE_WINDOW_PROPERTY_TYPE(views::internal::NativeWidgetPrivate*) 74 DECLARE_CLASS_PROPERTY_TYPE(views::internal::NativeWidgetPrivate*)
75 75
76 namespace views { 76 namespace views {
77 77
78 namespace { 78 namespace {
79 79
80 DEFINE_WINDOW_PROPERTY_KEY(internal::NativeWidgetPrivate*, 80 DEFINE_CLASS_PROPERTY_KEY(internal::NativeWidgetPrivate*,
81 kNativeWidgetPrivateKey, 81 kNativeWidgetPrivateKey,
82 nullptr); 82 nullptr);
83 83
84 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { 84 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
85 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); 85 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
86 } 86 }
87 87
88 void SetIcon(aura::Window* window, 88 void SetIcon(aura::Window* window,
89 const aura::WindowProperty<gfx::ImageSkia*>* key, 89 const aura::WindowProperty<gfx::ImageSkia*>* key,
90 const gfx::ImageSkia& value) { 90 const gfx::ImageSkia& value) {
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 gfx::NativeView native_view) { 1239 gfx::NativeView native_view) {
1240 aura::client::CaptureClient* capture_client = 1240 aura::client::CaptureClient* capture_client =
1241 aura::client::GetCaptureClient(native_view->GetRootWindow()); 1241 aura::client::GetCaptureClient(native_view->GetRootWindow());
1242 if (!capture_client) 1242 if (!capture_client)
1243 return nullptr; 1243 return nullptr;
1244 return capture_client->GetGlobalCaptureWindow(); 1244 return capture_client->GetGlobalCaptureWindow();
1245 } 1245 }
1246 1246
1247 } // namespace internal 1247 } // namespace internal
1248 } // namespace views 1248 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698