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

Side by Side Diff: ui/platform_window/x11/x11_window_factory.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698