Index: ui/base/resource/resource_bundle.cc |
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc |
index 2890c41b6e2e44c9e43bef6cddf6d63afe507a8a..90a96822c15aa141d13e84a3e1b1240443c74449 100644 |
--- a/ui/base/resource/resource_bundle.cc |
+++ b/ui/base/resource/resource_bundle.cc |
@@ -311,6 +311,11 @@ void ResourceBundle::OverrideLocalePakForTest(const base::FilePath& pak_path) { |
overridden_pak_path_ = pak_path; |
} |
+void ResourceBundle::OverrideStringResource( |
+ int message_id, const base::string16& overridding_string) { |
grt (UTC plus 2)
2014/06/11 01:51:18
did "git cl format" do this wrapping? if not, i be
grt (UTC plus 2)
2014/06/11 01:51:18
overridding_string -> string to match the declarat
jwd
2014/07/03 17:41:31
Done.
jwd
2014/07/03 17:41:31
Done.
|
+ overridden_strings_[message_id] = overridding_string; |
+} |
+ |
const base::FilePath& ResourceBundle::GetOverriddenPakPath() { |
return overridden_pak_path_; |
} |
@@ -439,6 +444,10 @@ base::string16 ResourceBundle::GetLocalizedString(int message_id) { |
if (delegate_ && delegate_->GetLocalizedString(message_id, &string)) |
return string; |
+ IdToStringMap::const_iterator it = overridden_strings_.find(message_id); |
+ if (it != overridden_strings_.end()) |
+ return it->second; |
+ |
// Ensure that ReloadLocaleResources() doesn't drop the resources while |
// we're using them. |
base::AutoLock lock_scope(*locale_resources_data_lock_); |