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

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..8b6dbddc3ccb09124a95b6513870151d2b71b9e1 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -245,6 +245,14 @@ 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 |overridding_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& overridding_string);
grt (UTC plus 2) 2014/06/09 16:54:44 nit: overridding_string -> string here and in comm
jwd 2014/06/10 20:59:25 Done.
+
// 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
@@ -391,6 +399,8 @@ class UI_BASE_EXPORT ResourceBundle {
base::FilePath overridden_pak_path_;
+ std::map<int, base::string16> overridden_strings_;
grt (UTC plus 2) 2014/06/09 16:54:44 suggestion: make a typdef for this up at the top o
jwd 2014/06/10 20:59:25 Done.
+
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