OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "headless/lib/browser/headless_window_tree_host.h" |
| 6 |
| 7 #include "ui/gfx/icc_profile.h" |
| 8 |
| 9 namespace headless { |
| 10 |
| 11 HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds) |
| 12 : bounds_(bounds) { |
| 13 CreateCompositor(); |
| 14 OnAcceleratedWidgetAvailable(); |
| 15 } |
| 16 |
| 17 HeadlessWindowTreeHost::~HeadlessWindowTreeHost() { |
| 18 DestroyCompositor(); |
| 19 DestroyDispatcher(); |
| 20 } |
| 21 |
| 22 bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) { |
| 23 return false; |
| 24 } |
| 25 |
| 26 uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) { |
| 27 return 0; |
| 28 } |
| 29 |
| 30 ui::EventSource* HeadlessWindowTreeHost::GetEventSource() { |
| 31 return this; |
| 32 } |
| 33 |
| 34 gfx::AcceleratedWidget HeadlessWindowTreeHost::GetAcceleratedWidget() { |
| 35 return gfx::AcceleratedWidget(); |
| 36 } |
| 37 |
| 38 gfx::Rect HeadlessWindowTreeHost::GetBoundsInPixels() const { |
| 39 return bounds_; |
| 40 } |
| 41 |
| 42 void HeadlessWindowTreeHost::SetBoundsInPixels(const gfx::Rect& bounds) { |
| 43 bool origin_changed = bounds_.origin() != bounds.origin(); |
| 44 bool size_changed = bounds_.size() != bounds.size(); |
| 45 bounds_ = bounds; |
| 46 if (origin_changed) |
| 47 OnHostMovedInPixels(bounds.origin()); |
| 48 if (size_changed) |
| 49 OnHostResizedInPixels(bounds.size()); |
| 50 } |
| 51 |
| 52 void HeadlessWindowTreeHost::ShowImpl() {} |
| 53 |
| 54 void HeadlessWindowTreeHost::HideImpl() {} |
| 55 |
| 56 gfx::Point HeadlessWindowTreeHost::GetLocationOnScreenInPixels() const { |
| 57 return gfx::Point(); |
| 58 } |
| 59 |
| 60 void HeadlessWindowTreeHost::SetCapture() {} |
| 61 |
| 62 void HeadlessWindowTreeHost::ReleaseCapture() {} |
| 63 |
| 64 void HeadlessWindowTreeHost::SetCursorNative(gfx::NativeCursor cursor_type) {} |
| 65 |
| 66 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( |
| 67 const gfx::Point& location) {} |
| 68 |
| 69 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} |
| 70 |
| 71 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { |
| 72 return gfx::ICCProfile(); |
| 73 } |
| 74 |
| 75 } // namespace headless |
OLD | NEW |