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

Side by Side Diff: ui/platform_window/platform_window_factory.cc

Issue 403263002: platform-window: Add a PlatformWindowFactory for creating windows. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win32 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/platform_window_factory.h"
6
7 #include "base/at_exit.h"
8 #include "base/bind.h"
9 #include "base/logging.h"
10
11 namespace ui {
12
13 namespace {
14
15 PlatformWindowFactory* instance = NULL;
16
17 } // namespace
18
19 PlatformWindowFactory::PlatformWindowFactory() {
20 CHECK(!instance) << "There can only be a single PlatformWindowFactory.";
21 instance = this;
22 base::AtExitManager::RegisterTask(
23 base::Bind(&base::DeletePointer<PlatformWindowFactory>, instance));
24 }
25
26 PlatformWindowFactory::~PlatformWindowFactory() {
27 CHECK_EQ(instance, this);
28 instance = NULL;
29 }
30
31 // static
32 PlatformWindowFactory* PlatformWindowFactory::GetInstance() {
33 return instance;
34 }
35
36 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698