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 "headless/lib/browser/headless_focus_client.h" | |
8 #include "headless/lib/browser/headless_window_parenting_client.h" | |
9 #include "ui/aura/window.h" | |
10 #include "ui/gfx/icc_profile.h" | 8 #include "ui/gfx/icc_profile.h" |
11 | 9 |
12 namespace headless { | 10 namespace headless { |
13 | 11 |
14 HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds) | 12 HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds) |
15 : bounds_(bounds) { | 13 : bounds_(bounds) { |
16 CreateCompositor(); | 14 CreateCompositor(); |
17 OnAcceleratedWidgetAvailable(); | 15 OnAcceleratedWidgetAvailable(); |
18 | |
19 focus_client_.reset(new HeadlessFocusClient()); | |
20 aura::client::SetFocusClient(window(), focus_client_.get()); | |
21 } | 16 } |
22 | 17 |
23 HeadlessWindowTreeHost::~HeadlessWindowTreeHost() { | 18 HeadlessWindowTreeHost::~HeadlessWindowTreeHost() { |
24 window_parenting_client_.reset(); | 19 window_parenting_client_.reset(); |
25 DestroyCompositor(); | 20 DestroyCompositor(); |
26 DestroyDispatcher(); | 21 DestroyDispatcher(); |
27 } | 22 } |
28 | 23 |
29 void HeadlessWindowTreeHost::SetParentWindow(gfx::NativeWindow window) { | 24 void HeadlessWindowTreeHost::SetParentWindow(gfx::NativeWindow window) { |
30 window_parenting_client_.reset(new HeadlessWindowParentingClient(window)); | 25 window_parenting_client_.reset(new HeadlessWindowParentingClient(window)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( | 72 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( |
78 const gfx::Point& location) {} | 73 const gfx::Point& location) {} |
79 | 74 |
80 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} | 75 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} |
81 | 76 |
82 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { | 77 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { |
83 return gfx::ICCProfile(); | 78 return gfx::ICCProfile(); |
84 } | 79 } |
85 | 80 |
86 } // namespace headless | 81 } // namespace headless |
OLD | NEW |