| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "headless/lib/browser/headless_window_tree_host.h" | 5 #include "headless/lib/browser/headless_window_tree_host.h" |
| 6 #include "ui/aura/window.h" |
| 6 | 7 |
| 7 #include "ui/gfx/icc_profile.h" | 8 #include "ui/gfx/icc_profile.h" |
| 8 | 9 |
| 9 namespace headless { | 10 namespace headless { |
| 10 | 11 |
| 11 HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds) | 12 HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds) |
| 12 : bounds_(bounds) { | 13 : bounds_(bounds) { |
| 13 CreateCompositor(); | 14 CreateCompositor(); |
| 14 OnAcceleratedWidgetAvailable(); | 15 OnAcceleratedWidgetAvailable(); |
| 15 } | 16 } |
| 16 | 17 |
| 17 HeadlessWindowTreeHost::~HeadlessWindowTreeHost() { | 18 HeadlessWindowTreeHost::~HeadlessWindowTreeHost() { |
| 19 window_parenting_client_.reset(); |
| 18 DestroyCompositor(); | 20 DestroyCompositor(); |
| 19 DestroyDispatcher(); | 21 DestroyDispatcher(); |
| 20 } | 22 } |
| 21 | 23 |
| 24 void HeadlessWindowTreeHost::SetParentWindow(gfx::NativeWindow window) { |
| 25 window_parenting_client_.reset(new HeadlessWindowParentingClient(window)); |
| 26 } |
| 27 |
| 22 bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) { | 28 bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) { |
| 23 return false; | 29 return false; |
| 24 } | 30 } |
| 25 | 31 |
| 26 uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) { | 32 uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) { |
| 27 return 0; | 33 return 0; |
| 28 } | 34 } |
| 29 | 35 |
| 30 ui::EventSource* HeadlessWindowTreeHost::GetEventSource() { | 36 ui::EventSource* HeadlessWindowTreeHost::GetEventSource() { |
| 31 return this; | 37 return this; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( | 72 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( |
| 67 const gfx::Point& location) {} | 73 const gfx::Point& location) {} |
| 68 | 74 |
| 69 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} | 75 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} |
| 70 | 76 |
| 71 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { | 77 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { |
| 72 return gfx::ICCProfile(); | 78 return gfx::ICCProfile(); |
| 73 } | 79 } |
| 74 | 80 |
| 75 } // namespace headless | 81 } // namespace headless |
| OLD | NEW |