Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: ui/base/resource/resource_bundle.h

Issue 322523002: Adding OverrideStringResource API to ResourceBundle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | ui/base/resource/resource_bundle.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.h
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h
index 809b1125159ef939b2cbddb450b36f9f7ed57da4..9a1a904724b62b8d22b504a81e26c434d1e69055 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -245,6 +245,12 @@ class UI_BASE_EXPORT ResourceBundle {
// loaded. Pass an empty path to undo.
void OverrideLocalePakForTest(const base::FilePath& pak_path);
+ // Overrides a localized string resource with the given string. If no delegate
+ // is present, the |string| will be returned when getting the localized string
+ // |message_id|. This is intended to be used in conjunction with field trials
+ // and the variations service to experiment with different UI strings.
+ void OverrideStringResource(int message_id, const base::string16& string);
+
// Returns the full pathname of the locale file to load. May return an empty
// string if no locale data files are found and |test_file_exists| is true.
// Used on Android to load the local file in the browser process and pass it
@@ -267,6 +273,8 @@ class UI_BASE_EXPORT ResourceBundle {
class ResourceBundleImageSource;
friend class ResourceBundleImageSource;
+ typedef base::hash_map<int, base::string16> IdToStringMap;
grt (UTC plus 2) 2014/06/11 01:51:18 #include "base/containers/hash_tables.h"
jwd 2014/07/03 17:41:31 Done.
+
// Ctor/dtor are private, since we're a singleton.
explicit ResourceBundle(Delegate* delegate);
~ResourceBundle();
@@ -391,6 +399,8 @@ class UI_BASE_EXPORT ResourceBundle {
base::FilePath overridden_pak_path_;
+ IdToStringMap overridden_strings_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
};
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | ui/base/resource/resource_bundle.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698