Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: headless/lib/browser/headless_window_tree_host.cc

Issue 2669693002: Minimize headless code that refers to aura. (Closed)
Patch Set: Add aura dependencies in BUIL.gn only when use_aura == true" Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 gfx::NativeWindow HeadlessWindowTreeHost::NativeWindow() {
25 return window();
26 }
27
28 void HeadlessWindowTreeHost::SetParentWindow(gfx::NativeWindow window) {
29 window_parenting_client_.reset(
30 new HeadlessWindowParentingClient(window));
31 }
32
33 gfx::NativeWindow HeadlessWindowTreeHost::GetTopWindowContainingPoint(
34 const gfx::Point& point) {
35 return this->NativeWindow()->GetTopWindowContainingPoint(point);
36 }
37
22 bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) { 38 bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) {
23 return false; 39 return false;
24 } 40 }
25 41
26 uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) { 42 uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) {
27 return 0; 43 return 0;
28 } 44 }
29 45
30 ui::EventSource* HeadlessWindowTreeHost::GetEventSource() { 46 ui::EventSource* HeadlessWindowTreeHost::GetEventSource() {
31 return this; 47 return this;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels( 82 void HeadlessWindowTreeHost::MoveCursorToScreenLocationInPixels(
67 const gfx::Point& location) {} 83 const gfx::Point& location) {}
68 84
69 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {} 85 void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {}
70 86
71 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() { 87 gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() {
72 return gfx::ICCProfile(); 88 return gfx::ICCProfile();
73 } 89 }
74 90
75 } // namespace headless 91 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698