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

Unified Diff: ui/ozone/platform/x11/ozone_platform_x11.cc

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes for comments + tests. Created 4 years, 10 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 | « ui/ozone/platform/x11/BUILD.gn ('k') | ui/platform_window/x11/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/x11/ozone_platform_x11.cc
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index 9dca6888cc668b76ddfbfbf9af5ed31ad1bea90c..34db2f399f957109d0a61900bb0a833e33e310bd 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
+#include "ui/events/platform/x11/x11_event_source_libevent.h"
#include "ui/ozone/common/native_display_delegate_ozone.h"
#include "ui/ozone/common/stub_overlay_manager.h"
#include "ui/ozone/platform/x11/x11_surface_factory.h"
@@ -17,6 +18,7 @@
#include "ui/ozone/public/ozone_platform.h" // nogncheck
#include "ui/ozone/public/system_input_injector.h"
#include "ui/platform_window/platform_window.h"
+#include "ui/platform_window/x11/x11_window_ozone.h"
namespace ui {
@@ -60,9 +62,11 @@ class OzonePlatformX11 : public OzonePlatform {
scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) override {
- // TODO(kylechar): Add PlatformWindow creation here.
- NOTREACHED();
- return nullptr;
+ scoped_ptr<X11WindowOzone> window =
+ make_scoped_ptr(new X11WindowOzone(event_source_.get(), delegate));
+ window->SetBounds(bounds);
+ window->Create();
+ return std::move(window);
}
scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
@@ -74,7 +78,7 @@ class OzonePlatformX11 : public OzonePlatform {
}
void InitializeUI() override {
- // TODO(kylechar): Add PlatformEventSource creation here.
+ event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
surface_factory_ozone_.reset(new X11SurfaceFactory());
overlay_manager_.reset(new StubOverlayManager());
input_controller_ = CreateStubInputController();
@@ -89,6 +93,7 @@ class OzonePlatformX11 : public OzonePlatform {
private:
// Objects in the Browser process.
+ scoped_ptr<X11EventSourceLibevent> event_source_;
scoped_ptr<OverlayManagerOzone> overlay_manager_;
scoped_ptr<InputController> input_controller_;
scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_;
« no previous file with comments | « ui/ozone/platform/x11/BUILD.gn ('k') | ui/platform_window/x11/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698