Index: ui/platform_window/x11/x11_window_factory.cc |
diff --git a/ui/platform_window/x11/x11_window_factory.cc b/ui/platform_window/x11/x11_window_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7d4cad6b5bbf0d2c7fa6fc21980378bbc9b55016 |
--- /dev/null |
+++ b/ui/platform_window/x11/x11_window_factory.cc |
@@ -0,0 +1,37 @@ |
+// 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/platform_window/x11/x11_window_factory.h" |
+ |
+#include "ui/events/platform/platform_event_source.h" |
+#include "ui/platform_window/x11/x11_window.h" |
+ |
+namespace ui { |
+ |
+X11WindowFactory::X11WindowFactory() |
+ : event_source_(ui::PlatformEventSource::CreateDefault()) { |
+} |
+ |
+X11WindowFactory::~X11WindowFactory() { |
+} |
+ |
+// static |
+PlatformWindowFactory* X11WindowFactory::CreateIfNecessary() { |
+ PlatformWindowFactory* instance = GetInstance(); |
+ if (!instance) |
+ new X11WindowFactory(); |
+ instance = GetInstance(); |
+ CHECK(instance); |
+ return instance; |
+} |
+ |
+scoped_ptr<PlatformWindow> X11WindowFactory::CreatePlatformWindow( |
+ PlatformWindowDelegate* delegate, |
+ const gfx::Rect& bounds) { |
+ scoped_ptr<PlatformWindow> window(new X11Window(delegate)); |
+ window->SetBounds(bounds); |
+ return window.Pass(); |
+} |
+ |
+} // namespace ui |