OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 /* static */ | 109 /* static */ |
110 void ResourceBundle::CleanupSharedInstance() { | 110 void ResourceBundle::CleanupSharedInstance() { |
111 if (g_shared_instance_) { | 111 if (g_shared_instance_) { |
112 delete g_shared_instance_; | 112 delete g_shared_instance_; |
113 g_shared_instance_ = NULL; | 113 g_shared_instance_ = NULL; |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 /* static */ | 117 /* static */ |
| 118 bool ResourceBundle::HasSharedInstance() { |
| 119 return g_shared_instance_ != NULL; |
| 120 } |
| 121 |
| 122 /* static */ |
118 ResourceBundle& ResourceBundle::GetSharedInstance() { | 123 ResourceBundle& ResourceBundle::GetSharedInstance() { |
119 // Must call InitSharedInstance before this function. | 124 // Must call InitSharedInstance before this function. |
120 CHECK(g_shared_instance_ != NULL); | 125 CHECK(g_shared_instance_ != NULL); |
121 return *g_shared_instance_; | 126 return *g_shared_instance_; |
122 } | 127 } |
123 | 128 |
124 /* static */ | 129 /* static */ |
125 bool ResourceBundle::LocaleDataPakExists(const std::string& locale) { | 130 bool ResourceBundle::LocaleDataPakExists(const std::string& locale) { |
126 return !GetLocaleFilePath(locale).empty(); | 131 return !GetLocaleFilePath(locale).empty(); |
127 } | 132 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 } | 415 } |
411 | 416 |
412 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( | 417 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( |
413 int resource_id) const { | 418 int resource_id) const { |
414 if (!data_pack_.get()) | 419 if (!data_pack_.get()) |
415 return NULL; | 420 return NULL; |
416 return data_pack_->GetStaticMemory(resource_id); | 421 return data_pack_->GetStaticMemory(resource_id); |
417 } | 422 } |
418 | 423 |
419 } // namespace ui | 424 } // namespace ui |
OLD | NEW |