OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/aura/window_tree_host_ozone.h" | 5 #include "ui/aura/window_tree_host_ozone.h" |
6 | 6 |
7 #include "ui/aura/window_event_dispatcher.h" | 7 #include "ui/aura/window_event_dispatcher.h" |
8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" | 8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" |
9 #include "ui/events/ozone/event_factory_ozone.h" | 9 #include "ui/events/ozone/event_factory_ozone.h" |
10 #include "ui/events/platform/platform_event_source.h" | 10 #include "ui/events/platform/platform_event_source.h" |
11 #include "ui/gfx/ozone/surface_factory_ozone.h" | 11 #include "ui/gfx/ozone/surface_factory_ozone.h" |
12 | 12 |
13 namespace aura { | 13 namespace aura { |
14 | 14 |
15 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) | 15 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds, |
| 16 ui::ContextFactory* context_factory) |
16 : widget_(0), | 17 : widget_(0), |
17 bounds_(bounds) { | 18 bounds_(bounds) { |
18 gfx::SurfaceFactoryOzone* surface_factory = | 19 gfx::SurfaceFactoryOzone* surface_factory = |
19 gfx::SurfaceFactoryOzone::GetInstance(); | 20 gfx::SurfaceFactoryOzone::GetInstance(); |
20 widget_ = surface_factory->GetAcceleratedWidget(); | 21 widget_ = surface_factory->GetAcceleratedWidget(); |
21 | 22 |
22 ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); | 23 ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); |
23 CreateCompositor(GetAcceleratedWidget()); | 24 CreateCompositor(GetAcceleratedWidget(), context_factory); |
24 } | 25 } |
25 | 26 |
26 WindowTreeHostOzone::~WindowTreeHostOzone() { | 27 WindowTreeHostOzone::~WindowTreeHostOzone() { |
27 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); | 28 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); |
28 DestroyCompositor(); | 29 DestroyCompositor(); |
29 DestroyDispatcher(); | 30 DestroyDispatcher(); |
30 } | 31 } |
31 | 32 |
32 bool WindowTreeHostOzone::CanDispatchEvent(const ui::PlatformEvent& ne) { | 33 bool WindowTreeHostOzone::CanDispatchEvent(const ui::PlatformEvent& ne) { |
33 CHECK(ne); | 34 CHECK(ne); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 99 |
99 void WindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) { | 100 void WindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) { |
100 NOTIMPLEMENTED(); | 101 NOTIMPLEMENTED(); |
101 } | 102 } |
102 | 103 |
103 ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() { | 104 ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() { |
104 return dispatcher(); | 105 return dispatcher(); |
105 } | 106 } |
106 | 107 |
107 // static | 108 // static |
108 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { | 109 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds, |
109 return new WindowTreeHostOzone(bounds); | 110 ui::ContextFactory* context_factory) { |
| 111 return new WindowTreeHostOzone(bounds, context_factory); |
110 } | 112 } |
111 | 113 |
112 // static | 114 // static |
113 gfx::Size WindowTreeHost::GetNativeScreenSize() { | 115 gfx::Size WindowTreeHost::GetNativeScreenSize() { |
114 NOTIMPLEMENTED(); | 116 NOTIMPLEMENTED(); |
115 return gfx::Size(); | 117 return gfx::Size(); |
116 } | 118 } |
117 | 119 |
118 } // namespace aura | 120 } // namespace aura |
OLD | NEW |