| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #if defined(OS_WIN) || defined(OS_ANDROID) || defined(USE_OZONE) | 34 #if defined(OS_WIN) || defined(OS_ANDROID) || defined(USE_OZONE) |
| 35 // static | 35 // static |
| 36 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { | 36 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
| 37 return new WindowTreeHostPlatform(bounds); | 37 return new WindowTreeHostPlatform(bounds); |
| 38 } | 38 } |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 WindowTreeHostPlatform::WindowTreeHostPlatform(const gfx::Rect& bounds) | 41 WindowTreeHostPlatform::WindowTreeHostPlatform(const gfx::Rect& bounds) |
| 42 : WindowTreeHostPlatform() { | 42 : WindowTreeHostPlatform() { |
| 43 CreateCompositor(); |
| 43 #if defined(USE_OZONE) | 44 #if defined(USE_OZONE) |
| 44 window_ = | 45 window_ = |
| 45 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); | 46 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); |
| 46 #elif defined(OS_WIN) | 47 #elif defined(OS_WIN) |
| 47 window_.reset(new ui::WinWindow(this, bounds)); | 48 window_.reset(new ui::WinWindow(this, bounds)); |
| 48 #elif defined(OS_ANDROID) | 49 #elif defined(OS_ANDROID) |
| 49 window_.reset(new ui::PlatformWindowAndroid(this)); | 50 window_.reset(new ui::PlatformWindowAndroid(this)); |
| 50 #else | 51 #else |
| 51 NOTIMPLEMENTED(); | 52 NOTIMPLEMENTED(); |
| 52 #endif | 53 #endif |
| 53 } | 54 } |
| 54 | 55 |
| 55 WindowTreeHostPlatform::WindowTreeHostPlatform() | 56 WindowTreeHostPlatform::WindowTreeHostPlatform() |
| 56 : WindowTreeHostPlatform(nullptr) {} | 57 : WindowTreeHostPlatform(nullptr) {} |
| 57 | 58 |
| 58 WindowTreeHostPlatform::WindowTreeHostPlatform( | 59 WindowTreeHostPlatform::WindowTreeHostPlatform( |
| 59 std::unique_ptr<WindowPort> window_port) | 60 std::unique_ptr<WindowPort> window_port) |
| 60 : WindowTreeHost(std::move(window_port)), | 61 : WindowTreeHost(std::move(window_port)), |
| 61 widget_(gfx::kNullAcceleratedWidget), | 62 widget_(gfx::kNullAcceleratedWidget), |
| 62 current_cursor_(ui::kCursorNull) { | 63 current_cursor_(ui::kCursorNull) { |
| 63 CreateCompositor(); | |
| 64 } | 64 } |
| 65 | 65 |
| 66 void WindowTreeHostPlatform::SetPlatformWindow( | 66 void WindowTreeHostPlatform::SetPlatformWindow( |
| 67 std::unique_ptr<ui::PlatformWindow> window) { | 67 std::unique_ptr<ui::PlatformWindow> window) { |
| 68 window_ = std::move(window); | 68 window_ = std::move(window); |
| 69 } | 69 } |
| 70 | 70 |
| 71 WindowTreeHostPlatform::~WindowTreeHostPlatform() { | 71 WindowTreeHostPlatform::~WindowTreeHostPlatform() { |
| 72 DestroyCompositor(); | 72 DestroyCompositor(); |
| 73 DestroyDispatcher(); | 73 DestroyDispatcher(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 DCHECK_EQ(widget, widget_); | 187 DCHECK_EQ(widget, widget_); |
| 188 widget_ = gfx::kNullAcceleratedWidget; | 188 widget_ = gfx::kNullAcceleratedWidget; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void WindowTreeHostPlatform::OnActivationChanged(bool active) { | 191 void WindowTreeHostPlatform::OnActivationChanged(bool active) { |
| 192 if (active) | 192 if (active) |
| 193 OnHostActivated(); | 193 OnHostActivated(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace aura | 196 } // namespace aura |
| OLD | NEW |