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

Unified Diff: ui/aura/window_tree_host_ozone.cc

Issue 205433005: ozone: Add OzoneWindowFactory & OzoneWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698