| Index: mojo/services/native_viewport/platform_viewport.cc
|
| diff --git a/mojo/services/native_viewport/native_viewport_ozone.cc b/mojo/services/native_viewport/platform_viewport.cc
|
| similarity index 64%
|
| rename from mojo/services/native_viewport/native_viewport_ozone.cc
|
| rename to mojo/services/native_viewport/platform_viewport.cc
|
| index fa5648f5a5f28fc85b7b84a3f9ea7a78f4f50b55..43a24560e7ad6df47d37dbe77a66fe61fb29257b 100644
|
| --- a/mojo/services/native_viewport/native_viewport_ozone.cc
|
| +++ b/mojo/services/native_viewport/platform_viewport.cc
|
| @@ -1,33 +1,24 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// 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 "mojo/services/native_viewport/native_viewport.h"
|
|
|
| -#include "ui/events/event.h"
|
| -#include "ui/events/platform/platform_event_dispatcher.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/ozone_platform.h"
|
| -#include "ui/ozone/public/surface_factory_ozone.h"
|
| -#include "ui/platform_window/platform_window.h"
|
| -#include "ui/platform_window/platform_window_delegate.h"
|
| +#include "ui/gfx/rect.h"
|
| +#include "ui/platform_window/platform_window_factory.h"
|
| +#include "ui/platform_window/types/platform_window.h"
|
| +#include "ui/platform_window/types/platform_window_delegate.h"
|
|
|
| namespace mojo {
|
| namespace services {
|
|
|
| -// TODO(spang): Deduplicate with NativeViewportX11.. but there's a hack
|
| -// in there that prevents this.
|
| -class NativeViewportOzone : public NativeViewport,
|
| - public ui::PlatformWindowDelegate {
|
| +class PlatformViewport : public NativeViewport,
|
| + public ui::PlatformWindowDelegate {
|
| public:
|
| - explicit NativeViewportOzone(NativeViewportDelegate* delegate)
|
| - : delegate_(delegate) {
|
| - ui::OzonePlatform::InitializeForUI();
|
| - }
|
| + explicit PlatformViewport(NativeViewportDelegate* delegate)
|
| + : delegate_(delegate) {}
|
|
|
| - virtual ~NativeViewportOzone() {
|
| + virtual ~PlatformViewport() {
|
| // Destroy the platform-window while |this| is still alive.
|
| platform_window_.reset();
|
| }
|
| @@ -35,8 +26,11 @@ class NativeViewportOzone : public NativeViewport,
|
| private:
|
| // Overridden from NativeViewport:
|
| virtual void Init(const gfx::Rect& bounds) OVERRIDE {
|
| + CHECK(!platform_window_);
|
| +
|
| platform_window_ =
|
| - ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
|
| + ui::PlatformWindowFactory::GetInstance()->CreatePlatformWindow(this,
|
| + bounds);
|
| }
|
|
|
| virtual void Show() OVERRIDE { platform_window_->Show(); }
|
| @@ -86,13 +80,13 @@ class NativeViewportOzone : public NativeViewport,
|
| scoped_ptr<ui::PlatformWindow> platform_window_;
|
| NativeViewportDelegate* delegate_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(NativeViewportOzone);
|
| + DISALLOW_COPY_AND_ASSIGN(PlatformViewport);
|
| };
|
|
|
| // static
|
| scoped_ptr<NativeViewport> NativeViewport::Create(
|
| NativeViewportDelegate* delegate) {
|
| - return scoped_ptr<NativeViewport>(new NativeViewportOzone(delegate)).Pass();
|
| + return scoped_ptr<NativeViewport>(new PlatformViewport(delegate));
|
| }
|
|
|
| } // namespace services
|
|
|