OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "app/resource_bundle.h" | |
6 | |
7 #include <atlbase.h> | |
8 #include <windows.h> | |
9 | |
10 #include "app/gfx/font.h" | |
11 #include "base/logging.h" | |
12 #include "base/win_util.h" | |
13 | |
14 ResourceBundle* ResourceBundle::g_shared_instance_ = NULL; | |
15 | |
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. | |
19 namespace gfx { | |
20 Font::HFontRef::~HFontRef() { | |
21 NOTREACHED(); | |
22 } | |
23 } | |
24 | |
25 | |
26 /* static */ | |
27 void ResourceBundle::InitSharedInstance(const std::wstring& pref_locale) { | |
28 DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice"; | |
29 g_shared_instance_ = new ResourceBundle(); | |
30 } | |
31 | |
32 /* static */ | |
33 void ResourceBundle::CleanupSharedInstance() { | |
34 if (g_shared_instance_) { | |
35 delete g_shared_instance_; | |
36 g_shared_instance_ = NULL; | |
37 } | |
38 } | |
39 | |
40 /* static */ | |
41 ResourceBundle& ResourceBundle::GetSharedInstance() { | |
42 // Must call InitSharedInstance before this function. | |
43 CHECK(g_shared_instance_ != NULL); | |
44 return *g_shared_instance_; | |
45 } | |
46 | |
47 ResourceBundle::ResourceBundle() | |
48 : resources_data_(NULL), | |
49 locale_resources_data_(NULL) { | |
50 } | |
51 | |
52 ResourceBundle::~ResourceBundle() { | |
53 } | |
54 | |
55 | |
56 string16 ResourceBundle::GetLocalizedString(int message_id) { | |
57 return std::wstring(); | |
58 } | |
OLD | NEW |