OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/platform_window/x11/x11_window_factory.h" |
| 6 |
| 7 #include "ui/events/platform/platform_event_source.h" |
| 8 #include "ui/platform_window/x11/x11_window.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 X11WindowFactory::X11WindowFactory() |
| 13 : event_source_(ui::PlatformEventSource::CreateDefault()) { |
| 14 } |
| 15 |
| 16 X11WindowFactory::~X11WindowFactory() { |
| 17 } |
| 18 |
| 19 // static |
| 20 PlatformWindowFactory* X11WindowFactory::CreateIfNecessary() { |
| 21 PlatformWindowFactory* instance = GetInstance(); |
| 22 if (!instance) |
| 23 new X11WindowFactory(); |
| 24 instance = GetInstance(); |
| 25 CHECK(instance); |
| 26 return instance; |
| 27 } |
| 28 |
| 29 scoped_ptr<PlatformWindow> X11WindowFactory::CreatePlatformWindow( |
| 30 PlatformWindowDelegate* delegate, |
| 31 const gfx::Rect& bounds) { |
| 32 scoped_ptr<PlatformWindow> window(new X11Window(delegate)); |
| 33 window->SetBounds(bounds); |
| 34 return window.Pass(); |
| 35 } |
| 36 |
| 37 } // namespace ui |
OLD | NEW |