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