1 // Copyright (c) 2006-2009 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.
5 #include "app/resource_bundle.h"
10 #include "base/logging.h"
12 #include "gfx/platform_font_win.h"
14 ResourceBundle
* ResourceBundle::g_shared_instance_
= NULL
;
16 // NOTE(gregoryd): This is a hack to avoid creating more nacl_win64-specific
17 // files. The font members of ResourceBundle are never initialized in our code
18 // so this destructor is never called.
23 PlatformFontWin::HFontRef::~HFontRef() {
30 std::string
ResourceBundle::InitSharedInstance(
31 const std::string
& pref_locale
) {
32 DCHECK(g_shared_instance_
== NULL
) << "ResourceBundle initialized twice";
33 g_shared_instance_
= new ResourceBundle();
38 void ResourceBundle::CleanupSharedInstance() {
39 if (g_shared_instance_
) {
40 delete g_shared_instance_
;
41 g_shared_instance_
= NULL
;
46 ResourceBundle
& ResourceBundle::GetSharedInstance() {
47 // Must call InitSharedInstance before this function.
48 CHECK(g_shared_instance_
!= NULL
);
49 return *g_shared_instance_
;
52 ResourceBundle::ResourceBundle()
54 resources_data_(NULL
),
55 locale_resources_data_(NULL
) {
58 ResourceBundle::~ResourceBundle() {
62 string16
ResourceBundle::GetLocalizedString(int message_id
) {
63 return std::wstring();