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

Unified Diff: mojo/services/native_viewport/platform_viewport.cc

Issue 403263002: platform-window: Add a PlatformWindowFactory for creating windows. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
« no previous file with comments | « mojo/services/native_viewport/native_viewport_x11.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « mojo/services/native_viewport/native_viewport_x11.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698