summaryrefslogtreecommitdiffstats
path: root/ui/aura/window_tree_host_ozone.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 18:54:58 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 18:54:58 +0000
commite8cf7330b0f4187726568d1363eb85d7fd404f16 (patch)
treeeee645c53b6381054c0955a8bba7490038a6b3ef /ui/aura/window_tree_host_ozone.cc
parent36f33ddbf966257d3f59239b10d61bb9b54688fd (diff)
downloadchromium_src-e8cf7330b0f4187726568d1363eb85d7fd404f16.zip
chromium_src-e8cf7330b0f4187726568d1363eb85d7fd404f16.tar.gz
chromium_src-e8cf7330b0f4187726568d1363eb85d7fd404f16.tar.bz2
Move root_window_host* in aura to window_tree_host*.
R=sky@chromium.org TBR=sky@chromium.org BUG= Review URL: https://codereview.chromium.org/160573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window_tree_host_ozone.cc')
-rw-r--r--ui/aura/window_tree_host_ozone.cc130
1 files changed, 130 insertions, 0 deletions
diff --git a/ui/aura/window_tree_host_ozone.cc b/ui/aura/window_tree_host_ozone.cc
new file mode 100644
index 0000000..4458965
--- /dev/null
+++ b/ui/aura/window_tree_host_ozone.cc
@@ -0,0 +1,130 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/aura/window_tree_host_ozone.h"
+
+#include "ui/aura/root_window.h"
+#include "ui/events/ozone/event_factory_ozone.h"
+#include "ui/gfx/ozone/surface_factory_ozone.h"
+#include "ui/ozone/ozone_platform.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.
+ ui::EventFactoryOzone::GetInstance()->StartProcessingEvents();
+
+ gfx::SurfaceFactoryOzone* surface_factory =
+ gfx::SurfaceFactoryOzone::GetInstance();
+ widget_ = surface_factory->GetAcceleratedWidget();
+
+ surface_factory->AttemptToResizeAcceleratedWidget(widget_, bounds_);
+
+ base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this);
+ CreateCompositor(GetAcceleratedWidget());
+}
+
+WindowTreeHostOzone::~WindowTreeHostOzone() {
+ base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0);
+ DestroyCompositor();
+}
+
+uint32_t WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) {
+ ui::Event* event = static_cast<ui::Event*>(ne);
+ ui::EventDispatchDetails details ALLOW_UNUSED = SendEventToProcessor(event);
+ return POST_DISPATCH_NONE;
+}
+
+RootWindow* WindowTreeHostOzone::GetRootWindow() {
+ return delegate_->AsRootWindow();
+}
+
+gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() {
+ return widget_;
+}
+
+void WindowTreeHostOzone::Show() { NOTIMPLEMENTED(); }
+
+void WindowTreeHostOzone::Hide() { NOTIMPLEMENTED(); }
+
+void WindowTreeHostOzone::ToggleFullScreen() { NOTIMPLEMENTED(); }
+
+gfx::Rect WindowTreeHostOzone::GetBounds() const { return bounds_; }
+
+void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Insets WindowTreeHostOzone::GetInsets() const { return gfx::Insets(); }
+
+void WindowTreeHostOzone::SetInsets(const gfx::Insets& insets) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const {
+ return bounds_.origin();
+}
+
+void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); }
+
+void WindowTreeHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); }
+
+void WindowTreeHostOzone::SetCursor(gfx::NativeCursor cursor) {
+ gfx::SurfaceFactoryOzone::GetInstance()->SetCursorImage(*cursor.platform());
+}
+
+bool WindowTreeHostOzone::QueryMouseLocation(gfx::Point* location_return) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool WindowTreeHostOzone::ConfineCursorToRootWindow() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void WindowTreeHostOzone::UnConfineCursor() { NOTIMPLEMENTED(); }
+
+void WindowTreeHostOzone::OnCursorVisibilityChanged(bool show) {
+ NOTIMPLEMENTED();
+}
+
+void WindowTreeHostOzone::MoveCursorTo(const gfx::Point& location) {
+ gfx::SurfaceFactoryOzone::GetInstance()->MoveCursorTo(location);
+}
+
+void WindowTreeHostOzone::PostNativeEvent(
+ const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+}
+
+void WindowTreeHostOzone::OnDeviceScaleFactorChanged(
+ float device_scale_factor) {
+ NOTIMPLEMENTED();
+}
+
+void WindowTreeHostOzone::PrepareForShutdown() { NOTIMPLEMENTED(); }
+
+ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() {
+ return delegate_->GetEventProcessor();
+}
+
+// static
+WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
+ return new WindowTreeHostOzone(bounds);
+}
+
+// static
+gfx::Size WindowTreeHost::GetNativeScreenSize() {
+ NOTIMPLEMENTED();
+ return gfx::Size();
+}
+
+} // namespace aura