| 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 <windows.h> | |
| 8 | |
| 9 #include "base/lock.h" | |
| 10 #include "base/logging.h" | |
| 11 #include "gfx/font.h" | |
| 12 #include "gfx/platform_font_win.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::~Font() { | |
| 21 NOTREACHED(); | |
| 22 } | |
| 23 PlatformFontWin::HFontRef::~HFontRef() { | |
| 24 NOTREACHED(); | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 | |
| 29 /* static */ | |
| 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(); | |
| 34 return std::string(); | |
| 35 } | |
| 36 | |
| 37 /* static */ | |
| 38 void ResourceBundle::CleanupSharedInstance() { | |
| 39 if (g_shared_instance_) { | |
| 40 delete g_shared_instance_; | |
| 41 g_shared_instance_ = NULL; | |
| 42 } | |
| 43 } | |
| 44 | |
| 45 /* static */ | |
| 46 ResourceBundle& ResourceBundle::GetSharedInstance() { | |
| 47 // Must call InitSharedInstance before this function. | |
| 48 CHECK(g_shared_instance_ != NULL); | |
| 49 return *g_shared_instance_; | |
| 50 } | |
| 51 | |
| 52 ResourceBundle::ResourceBundle() | |
| 53 : lock_(new Lock), | |
| 54 resources_data_(NULL), | |
| 55 locale_resources_data_(NULL) { | |
| 56 } | |
| 57 | |
| 58 ResourceBundle::~ResourceBundle() { | |
| 59 } | |
| 60 | |
| 61 | |
| 62 string16 ResourceBundle::GetLocalizedString(int message_id) { | |
| 63 return string16(); | |
| 64 } | |
| OLD | NEW |