Index: ui/aura/window_tree_host_ozone.cc |
diff --git a/ui/aura/window_tree_host_ozone.cc b/ui/aura/window_tree_host_ozone.cc |
index b5dc6662b077bbf5715ed5c783b4a069cbabee00..97045bf0a935ee156d97865d1bdff923122a033f 100644 |
--- a/ui/aura/window_tree_host_ozone.cc |
+++ b/ui/aura/window_tree_host_ozone.cc |
@@ -5,27 +5,19 @@ |
#include "ui/aura/window_tree_host_ozone.h" |
#include "ui/aura/window_event_dispatcher.h" |
-#include "ui/base/cursor/ozone/cursor_factory_ozone.h" |
-#include "ui/events/ozone/event_factory_ozone.h" |
-#include "ui/gfx/ozone/surface_factory_ozone.h" |
#include "ui/ozone/ozone_platform.h" |
+#include "ui/ozone/window/ozone_window.h" |
+#include "ui/ozone/window/window_factory_ozone.h" |
namespace aura { |
-WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) |
- : widget_(0), |
- bounds_(bounds) { |
- ui::OzonePlatform::Initialize(); |
- |
- // EventFactoryOzone creates converters that obtain input events from the |
- // underlying input system and dispatch them as |ui::Event| instances into |
- // Aura. |
+WindowTreeHostOzone::WindowTreeHostOzone( |
+ scoped_ptr<ui::OzoneWindow> ozone_window) |
+ : ozone_window_(ozone_window.Pass()) { |
+ // TODO(spang): Don't use EventFactoryOzone here. We should do |
+ // something like: window_->AddPlatformEventDispatcherHandlerController(this); |
ui::EventFactoryOzone::GetInstance()->StartProcessingEvents(); |
- gfx::SurfaceFactoryOzone* surface_factory = |
- gfx::SurfaceFactoryOzone::GetInstance(); |
- widget_ = surface_factory->GetAcceleratedWidget(); |
- |
base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this); |
CreateCompositor(GetAcceleratedWidget()); |
} |
@@ -43,7 +35,7 @@ uint32_t WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) { |
} |
gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() { |
- return widget_; |
+ return ozone_window_->GetAcceleratedWidget(); |
} |
void WindowTreeHostOzone::Show() { NOTIMPLEMENTED(); } |
@@ -52,7 +44,9 @@ void WindowTreeHostOzone::Hide() { NOTIMPLEMENTED(); } |
void WindowTreeHostOzone::ToggleFullScreen() { NOTIMPLEMENTED(); } |
-gfx::Rect WindowTreeHostOzone::GetBounds() const { return bounds_; } |
+gfx::Rect WindowTreeHostOzone::GetBounds() const { |
+ return ozone_window_->GetBounds(); |
+} |
void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { |
NOTIMPLEMENTED(); |
@@ -65,7 +59,7 @@ void WindowTreeHostOzone::SetInsets(const gfx::Insets& insets) { |
} |
gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { |
- return bounds_.origin(); |
+ return gfx::Point(); |
} |
void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); } |
@@ -97,13 +91,11 @@ void WindowTreeHostOzone::OnDeviceScaleFactorChanged( |
void WindowTreeHostOzone::PrepareForShutdown() { NOTIMPLEMENTED(); } |
void WindowTreeHostOzone::SetCursorNative(gfx::NativeCursor cursor) { |
- ui::CursorFactoryOzone::GetInstance()->SetCursor(GetAcceleratedWidget(), |
- cursor.platform()); |
+ ozone_window_->SetCursor(cursor.platform()); |
} |
void WindowTreeHostOzone::MoveCursorToNative(const gfx::Point& location) { |
- ui::EventFactoryOzone::GetInstance()->WarpCursorTo(GetAcceleratedWidget(), |
- location); |
+ ozone_window_->WarpCursorTo(location); |
} |
void WindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) { |
@@ -116,7 +108,10 @@ ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() { |
// static |
WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
- return new WindowTreeHostOzone(bounds); |
+ ui::OzonePlatform::Initialize(); |
+ scoped_ptr<ui::OzoneWindow> ozone_window = |
+ ui::WindowFactoryOzone::GetInstance()->CreateWindow(bounds); |
+ return new WindowTreeHostOzone(ozone_window.Pass()); |
} |
// static |