Commit 6fa58150 authored by spang@chromium.org's avatar spang@chromium.org

ozone: Port WindowTreeHostOzone on top of PlatformWindow

Most of the WindowTreeHost functionality is actually implemented by the
platform window, so there's not much in WindowTreeHostOzone aside from
forwarding calls to and from the platform part.
    
Should be no functional change for in-tree platforms. To accomplish
that, this adds a transitional class PlatformWindowCompat that
implements PlatformWindow functions as WindowTreeHostOzone did before.
As a followup, we'll convert each platform to use the new PlatformWindow
natively & then remove PlatformWindowCompat.

BUG=392280
TEST=built with chromeos==1 use_ozone==1 & ran all platforms.
NOTRY=true
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/375053002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283573 0039d316-1c4b-4281-b951-d872f2087c98
parent f0324ee1
...@@ -8,6 +8,7 @@ include_rules = [ ...@@ -8,6 +8,7 @@ include_rules = [
"+ui/metro_viewer", # TODO(beng): investigate moving remote_root_window_host "+ui/metro_viewer", # TODO(beng): investigate moving remote_root_window_host
# to ui/metro_viewer. # to ui/metro_viewer.
"+ui/ozone/public", "+ui/ozone/public",
"+ui/platform_window",
"+ui/wm/public", "+ui/wm/public",
] ]
...@@ -5,43 +5,55 @@ ...@@ -5,43 +5,55 @@
#include "ui/aura/window_tree_host_ozone.h" #include "ui/aura/window_tree_host_ozone.h"
#include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_event_dispatcher.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/ozone/public/cursor_factory_ozone.h" #include "ui/ozone/public/cursor_factory_ozone.h"
#include "ui/ozone/public/event_factory_ozone.h" #include "ui/ozone/public/event_factory_ozone.h"
#include "ui/ozone/public/surface_factory_ozone.h" #include "ui/ozone/public/ozone_platform.h"
#include "ui/platform_window/platform_window.h"
namespace aura { namespace aura {
WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds)
: widget_(0), : widget_(gfx::kNullAcceleratedWidget) {
bounds_(bounds) { platform_window_ =
ui::SurfaceFactoryOzone* surface_factory = ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
ui::SurfaceFactoryOzone::GetInstance();
widget_ = surface_factory->GetAcceleratedWidget();
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
CreateCompositor(GetAcceleratedWidget());
} }
WindowTreeHostOzone::~WindowTreeHostOzone() { WindowTreeHostOzone::~WindowTreeHostOzone() {
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
DestroyCompositor(); DestroyCompositor();
DestroyDispatcher(); DestroyDispatcher();
} }
bool WindowTreeHostOzone::CanDispatchEvent(const ui::PlatformEvent& ne) { void WindowTreeHostOzone::OnBoundsChanged(const gfx::Rect& new_bounds) {
CHECK(ne); // TOOD(spang): Should we determine which parts changed?
ui::Event* event = static_cast<ui::Event*>(ne); OnHostResized(new_bounds.size());
if (event->IsMouseEvent() || event->IsScrollEvent()) OnHostMoved(new_bounds.origin());
return ui::CursorFactoryOzone::GetInstance()->GetCursorWindow() == widget_; }
return true; void WindowTreeHostOzone::OnDamageRect(const gfx::Rect& damaged_region) {
} }
uint32_t WindowTreeHostOzone::DispatchEvent(const ui::PlatformEvent& ne) { void WindowTreeHostOzone::DispatchEvent(ui::Event* event) {
ui::Event* event = static_cast<ui::Event*>(ne); SendEventToProcessor(event);
ui::EventDispatchDetails details ALLOW_UNUSED = SendEventToProcessor(event); }
return ui::POST_DISPATCH_STOP_PROPAGATION;
void WindowTreeHostOzone::OnCloseRequest() {
OnHostCloseRequested();
}
void WindowTreeHostOzone::OnClosed() {
}
void WindowTreeHostOzone::OnWindowStateChanged(
ui::PlatformWindowState new_state) {
}
void WindowTreeHostOzone::OnLostCapture() {
}
void WindowTreeHostOzone::OnAcceleratedWidgetAvailable(
gfx::AcceleratedWidget widget) {
widget_ = widget;
CreateCompositor(widget_);
} }
ui::EventSource* WindowTreeHostOzone::GetEventSource() { ui::EventSource* WindowTreeHostOzone::GetEventSource() {
...@@ -52,29 +64,33 @@ gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() { ...@@ -52,29 +64,33 @@ gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() {
return widget_; return widget_;
} }
void WindowTreeHostOzone::Show() { NOTIMPLEMENTED(); } void WindowTreeHostOzone::Show() {
platform_window_->Show();
}
void WindowTreeHostOzone::Hide() { NOTIMPLEMENTED(); } void WindowTreeHostOzone::Hide() {
platform_window_->Hide();
}
gfx::Rect WindowTreeHostOzone::GetBounds() const { return bounds_; } gfx::Rect WindowTreeHostOzone::GetBounds() const {
return platform_window_->GetBounds();
}
void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
bool origin_changed = bounds_.origin() != bounds.origin(); platform_window_->SetBounds(bounds);
bool size_changed = bounds_.size() != bounds.size();
bounds_ = bounds;
if (size_changed)
OnHostResized(bounds_.size());
if (origin_changed)
OnHostMoved(bounds_.origin());
} }
gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const {
return bounds_.origin(); return platform_window_->GetBounds().origin();
} }
void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); } void WindowTreeHostOzone::SetCapture() {
platform_window_->SetCapture();
}
void WindowTreeHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); } void WindowTreeHostOzone::ReleaseCapture() {
platform_window_->ReleaseCapture();
}
void WindowTreeHostOzone::PostNativeEvent( void WindowTreeHostOzone::PostNativeEvent(
const base::NativeEvent& native_event) { const base::NativeEvent& native_event) {
......
...@@ -5,28 +5,36 @@ ...@@ -5,28 +5,36 @@
#ifndef UI_AURA_WINDOW_TREE_HOST_OZONE_H_ #ifndef UI_AURA_WINDOW_TREE_HOST_OZONE_H_
#define UI_AURA_WINDOW_TREE_HOST_OZONE_H_ #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_
#include <vector>
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
#include "ui/events/event_source.h" #include "ui/events/event_source.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
#include "ui/platform_window/platform_window_delegate.h"
namespace ui {
class PlatformWindow;
}
namespace aura { namespace aura {
class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost,
public ui::EventSource, public ui::EventSource,
public ui::PlatformEventDispatcher { public ui::PlatformWindowDelegate {
public: public:
explicit WindowTreeHostOzone(const gfx::Rect& bounds); explicit WindowTreeHostOzone(const gfx::Rect& bounds);
virtual ~WindowTreeHostOzone(); virtual ~WindowTreeHostOzone();
private: private:
// ui::PlatformEventDispatcher: // ui::PlatformWindowDelegate:
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect&) OVERRIDE;
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE;
virtual void DispatchEvent(ui::Event* event) OVERRIDE;
virtual void OnCloseRequest() OVERRIDE;
virtual void OnClosed() OVERRIDE;
virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE;
virtual void OnLostCapture() OVERRIDE;
virtual void OnAcceleratedWidgetAvailable(
gfx::AcceleratedWidget widget) OVERRIDE;
// WindowTreeHost: // WindowTreeHost:
virtual ui::EventSource* GetEventSource() OVERRIDE; virtual ui::EventSource* GetEventSource() OVERRIDE;
...@@ -46,8 +54,11 @@ class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, ...@@ -46,8 +54,11 @@ class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost,
// ui::EventSource overrides. // ui::EventSource overrides.
virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
// Platform-specific part of this WindowTreeHost.
scoped_ptr<ui::PlatformWindow> platform_window_;
// The identifier used to create a compositing surface.
gfx::AcceleratedWidget widget_; gfx::AcceleratedWidget widget_;
gfx::Rect bounds_;
DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone);
}; };
......
...@@ -5,4 +5,5 @@ include_rules = [ ...@@ -5,4 +5,5 @@ include_rules = [
"+ui/events", "+ui/events",
"+ui/gfx", "+ui/gfx",
"+ui/base/cursor", "+ui/base/cursor",
"+ui/platform_window",
] ]
// Copyright 2014 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/ozone/common/window/platform_window_compat.h"
#include "ui/events/event.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/ozone/public/cursor_factory_ozone.h"
#include "ui/ozone/public/event_factory_ozone.h"
#include "ui/ozone/public/surface_factory_ozone.h"
#include "ui/platform_window/platform_window_delegate.h"
namespace ui {
PlatformWindowCompat::PlatformWindowCompat(PlatformWindowDelegate* delegate,
const gfx::Rect& bounds)
: delegate_(delegate), bounds_(bounds) {
widget_ = SurfaceFactoryOzone::GetInstance()->GetAcceleratedWidget();
delegate_->OnAcceleratedWidgetAvailable(widget_);
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
}
PlatformWindowCompat::~PlatformWindowCompat() {
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
}
bool PlatformWindowCompat::CanDispatchEvent(const ui::PlatformEvent& ne) {
CHECK(ne);
ui::Event* event = static_cast<ui::Event*>(ne);
if (event->IsMouseEvent() || event->IsScrollEvent())
return ui::CursorFactoryOzone::GetInstance()->GetCursorWindow() == widget_;
return true;
}
uint32_t PlatformWindowCompat::DispatchEvent(const ui::PlatformEvent& ne) {
ui::Event* event = static_cast<ui::Event*>(ne);
delegate_->DispatchEvent(event);
return ui::POST_DISPATCH_STOP_PROPAGATION;
}
gfx::Rect PlatformWindowCompat::GetBounds() {
return bounds_;
}
void PlatformWindowCompat::SetBounds(const gfx::Rect& bounds) {
bounds_ = bounds;
delegate_->OnBoundsChanged(bounds);
}
void PlatformWindowCompat::Show() {
}
void PlatformWindowCompat::Hide() {
}
void PlatformWindowCompat::Close() {
}
void PlatformWindowCompat::SetCapture() {
}
void PlatformWindowCompat::ReleaseCapture() {
}
void PlatformWindowCompat::ToggleFullscreen() {
}
void PlatformWindowCompat::Maximize() {
}
void PlatformWindowCompat::Minimize() {
}
void PlatformWindowCompat::Restore() {
}
} // namespace ui
// Copyright 2014 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.
#ifndef UI_OZONE_COMMON_WINDOW_PLATFORM_WINDOW_COMPAT_H_
#define UI_OZONE_COMMON_WINDOW_PLATFORM_WINDOW_COMPAT_H_
#include "ui/base/cursor/cursor.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ozone/ozone_export.h"
#include "ui/platform_window/platform_window.h"
namespace gfx {
class Point;
class Rect;
}
namespace ui {
class PlatformWindowDelegate;
// This is just transitional code. Will be removed shortly.
class OZONE_EXPORT PlatformWindowCompat : public PlatformWindow,
public ui::PlatformEventDispatcher {
public:
PlatformWindowCompat(PlatformWindowDelegate* delegate,
const gfx::Rect& bounds);
virtual ~PlatformWindowCompat();
// ui::PlatformEventDispatcher:
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
// PlatformWindow:
virtual gfx::Rect GetBounds() OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void Show() OVERRIDE;
virtual void Hide() OVERRIDE;
virtual void Close() OVERRIDE;
virtual void SetCapture() OVERRIDE;
virtual void ReleaseCapture() OVERRIDE;
virtual void ToggleFullscreen() OVERRIDE;
virtual void Maximize() OVERRIDE;
virtual void Minimize() OVERRIDE;
virtual void Restore() OVERRIDE;
private:
PlatformWindowDelegate* delegate_;
gfx::AcceleratedWidget widget_;
gfx::Rect bounds_;
DISALLOW_COPY_AND_ASSIGN(PlatformWindowCompat);
};
} // namespace ui
#endif // UI_OZONE_COMMON_WINDOW_PLATFORM_WINDOW_COMPAT_H_
...@@ -100,6 +100,8 @@ ...@@ -100,6 +100,8 @@
'common/gpu/ozone_gpu_message_params.cc', 'common/gpu/ozone_gpu_message_params.cc',
'common/gpu/ozone_gpu_message_params.h', 'common/gpu/ozone_gpu_message_params.h',
'common/gpu/ozone_gpu_messages.h', 'common/gpu/ozone_gpu_messages.h',
'common/window/platform_window_compat.cc',
'common/window/platform_window_compat.h',
'public/ozone_platform.cc', 'public/ozone_platform.cc',
'public/ozone_platform.h', 'public/ozone_platform.h',
'public/ozone_switches.cc', 'public/ozone_switches.cc',
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ui/ozone/platform/caca/ozone_platform_caca.h" #include "ui/ozone/platform/caca/ozone_platform_caca.h"
#include "ui/ozone/common/window/platform_window_compat.h"
#include "ui/ozone/platform/caca/caca_connection.h" #include "ui/ozone/platform/caca/caca_connection.h"
#include "ui/ozone/platform/caca/caca_event_factory.h" #include "ui/ozone/platform/caca/caca_event_factory.h"
#include "ui/ozone/platform/caca/caca_surface_factory.h" #include "ui/ozone/platform/caca/caca_surface_factory.h"
...@@ -40,6 +41,12 @@ class OzonePlatformCaca : public OzonePlatform { ...@@ -40,6 +41,12 @@ class OzonePlatformCaca : public OzonePlatform {
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
return NULL; // no GPU support return NULL; // no GPU support
} }
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
return make_scoped_ptr<PlatformWindow>(
new PlatformWindowCompat(delegate, bounds));
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/cursor_delegate_evdev.h" #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/common/window/platform_window_compat.h"
#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
#include "ui/ozone/platform/dri/dri_surface.h" #include "ui/ozone/platform/dri/dri_surface.h"
#include "ui/ozone/platform/dri/dri_surface_factory.h" #include "ui/ozone/platform/dri/dri_surface_factory.h"
...@@ -77,6 +78,12 @@ class OzonePlatformDri : public OzonePlatform { ...@@ -77,6 +78,12 @@ class OzonePlatformDri : public OzonePlatform {
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
return NULL; // no GPU support return NULL; // no GPU support
} }
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
return make_scoped_ptr<PlatformWindow>(
new PlatformWindowCompat(delegate, bounds));
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
OVERRIDE { OVERRIDE {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/at_exit.h" #include "base/at_exit.h"
#include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/common/window/platform_window_compat.h"
#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
#include "ui/ozone/platform/dri/dri_wrapper.h" #include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/platform/dri/gbm_buffer.h" #include "ui/ozone/platform/dri/gbm_buffer.h"
...@@ -107,6 +108,12 @@ class OzonePlatformGbm : public OzonePlatform { ...@@ -107,6 +108,12 @@ class OzonePlatformGbm : public OzonePlatform {
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
return gpu_platform_support_host_.get(); return gpu_platform_support_host_.get();
} }
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
return make_scoped_ptr<PlatformWindow>(
new PlatformWindowCompat(delegate, bounds));
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
OVERRIDE { OVERRIDE {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/gfx/vsync_provider.h" #include "ui/gfx/vsync_provider.h"
#include "ui/ozone/common/window/platform_window_compat.h"
#include "ui/ozone/public/cursor_factory_ozone.h" #include "ui/ozone/public/cursor_factory_ozone.h"
#include "ui/ozone/public/gpu_platform_support.h" #include "ui/ozone/public/gpu_platform_support.h"
#include "ui/ozone/public/gpu_platform_support_host.h" #include "ui/ozone/public/gpu_platform_support_host.h"
...@@ -260,6 +261,12 @@ class OzonePlatformEgltest : public OzonePlatform { ...@@ -260,6 +261,12 @@ class OzonePlatformEgltest : public OzonePlatform {
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
return gpu_platform_support_host_.get(); return gpu_platform_support_host_.get();
} }
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
return make_scoped_ptr<PlatformWindow>(
new PlatformWindowCompat(delegate, bounds));
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/common/window/platform_window_compat.h"
#include "ui/ozone/platform/test/file_surface_factory.h" #include "ui/ozone/platform/test/file_surface_factory.h"
#include "ui/ozone/platform/test/test_cursor_factory.h" #include "ui/ozone/platform/test/test_cursor_factory.h"
#include "ui/ozone/public/gpu_platform_support.h" #include "ui/ozone/public/gpu_platform_support.h"
...@@ -48,6 +49,12 @@ class OzonePlatformTest : public OzonePlatform { ...@@ -48,6 +49,12 @@ class OzonePlatformTest : public OzonePlatform {
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
return gpu_platform_support_host_.get(); return gpu_platform_support_host_.get();
} }
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
return make_scoped_ptr<PlatformWindow>(
new PlatformWindowCompat(delegate, bounds));
}
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "ui/ozone/ozone_export.h" #include "ui/ozone/ozone_export.h"
namespace gfx {
class Rect;
}
namespace ui { namespace ui {
class CursorFactoryOzone; class CursorFactoryOzone;
...@@ -17,6 +21,8 @@ class SurfaceFactoryOzone; ...@@ -17,6 +21,8 @@ class SurfaceFactoryOzone;
class TouchscreenDeviceManager; class TouchscreenDeviceManager;
class GpuPlatformSupport; class GpuPlatformSupport;
class GpuPlatformSupportHost; class GpuPlatformSupportHost;
class PlatformWindow;
class PlatformWindowDelegate;
// Base class for Ozone platform implementations. // Base class for Ozone platform implementations.
// //
...@@ -54,6 +60,9 @@ class OZONE_EXPORT OzonePlatform { ...@@ -54,6 +60,9 @@ class OZONE_EXPORT OzonePlatform {
virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0;
virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0; virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0;
virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0;
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) = 0;
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
virtual scoped_ptr<ui::NativeDisplayDelegate> virtual scoped_ptr<ui::NativeDisplayDelegate>
CreateNativeDisplayDelegate() = 0; CreateNativeDisplayDelegate() = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment