| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/aura/window_tree_host_platform.h" | 5 #include "ui/aura/window_tree_host_platform.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_event_dispatcher.h" |
| 12 #include "ui/aura/window_port.h" |
| 12 #include "ui/compositor/compositor.h" | 13 #include "ui/compositor/compositor.h" |
| 13 #include "ui/display/display.h" | 14 #include "ui/display/display.h" |
| 14 #include "ui/display/screen.h" | 15 #include "ui/display/screen.h" |
| 15 #include "ui/events/event.h" | 16 #include "ui/events/event.h" |
| 16 | 17 |
| 17 #if defined(OS_ANDROID) | 18 #if defined(OS_ANDROID) |
| 18 #include "ui/platform_window/android/platform_window_android.h" | 19 #include "ui/platform_window/android/platform_window_android.h" |
| 19 #endif | 20 #endif |
| 20 | 21 |
| 21 #if defined(USE_OZONE) | 22 #if defined(USE_OZONE) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 #elif defined(OS_WIN) | 46 #elif defined(OS_WIN) |
| 46 window_.reset(new ui::WinWindow(this, bounds)); | 47 window_.reset(new ui::WinWindow(this, bounds)); |
| 47 #elif defined(OS_ANDROID) | 48 #elif defined(OS_ANDROID) |
| 48 window_.reset(new ui::PlatformWindowAndroid(this)); | 49 window_.reset(new ui::PlatformWindowAndroid(this)); |
| 49 #else | 50 #else |
| 50 NOTIMPLEMENTED(); | 51 NOTIMPLEMENTED(); |
| 51 #endif | 52 #endif |
| 52 } | 53 } |
| 53 | 54 |
| 54 WindowTreeHostPlatform::WindowTreeHostPlatform() | 55 WindowTreeHostPlatform::WindowTreeHostPlatform() |
| 55 : widget_(gfx::kNullAcceleratedWidget), | 56 : WindowTreeHostPlatform(nullptr) {} |
| 57 |
| 58 WindowTreeHostPlatform::WindowTreeHostPlatform( |
| 59 std::unique_ptr<WindowPort> window_port) |
| 60 : WindowTreeHost(std::move(window_port)), |
| 61 widget_(gfx::kNullAcceleratedWidget), |
| 56 current_cursor_(ui::kCursorNull) { | 62 current_cursor_(ui::kCursorNull) { |
| 57 CreateCompositor(); | 63 CreateCompositor(); |
| 58 } | 64 } |
| 59 | 65 |
| 60 void WindowTreeHostPlatform::SetPlatformWindow( | 66 void WindowTreeHostPlatform::SetPlatformWindow( |
| 61 std::unique_ptr<ui::PlatformWindow> window) { | 67 std::unique_ptr<ui::PlatformWindow> window) { |
| 62 window_ = std::move(window); | 68 window_ = std::move(window); |
| 63 } | 69 } |
| 64 | 70 |
| 65 WindowTreeHostPlatform::~WindowTreeHostPlatform() { | 71 WindowTreeHostPlatform::~WindowTreeHostPlatform() { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 DCHECK_EQ(widget, widget_); | 187 DCHECK_EQ(widget, widget_); |
| 182 widget_ = gfx::kNullAcceleratedWidget; | 188 widget_ = gfx::kNullAcceleratedWidget; |
| 183 } | 189 } |
| 184 | 190 |
| 185 void WindowTreeHostPlatform::OnActivationChanged(bool active) { | 191 void WindowTreeHostPlatform::OnActivationChanged(bool active) { |
| 186 if (active) | 192 if (active) |
| 187 OnHostActivated(); | 193 OnHostActivated(); |
| 188 } | 194 } |
| 189 | 195 |
| 190 } // namespace aura | 196 } // namespace aura |
| OLD | NEW |