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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | ui/base/resource/resource_bundle.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 const gfx::Font& GetFont(FontStyle style); 238 const gfx::Font& GetFont(FontStyle style);
239 239
240 // Resets and reloads the cached fonts. This is useful when the fonts of the 240 // Resets and reloads the cached fonts. This is useful when the fonts of the
241 // system have changed, for example, when the locale has changed. 241 // system have changed, for example, when the locale has changed.
242 void ReloadFonts(); 242 void ReloadFonts();
243 243
244 // Overrides the path to the pak file from which the locale resources will be 244 // Overrides the path to the pak file from which the locale resources will be
245 // loaded. Pass an empty path to undo. 245 // loaded. Pass an empty path to undo.
246 void OverrideLocalePakForTest(const base::FilePath& pak_path); 246 void OverrideLocalePakForTest(const base::FilePath& pak_path);
247 247
248 // Overrides a localized string resource with the given string. If no delegate
249 // is present, the |overridding_string| will be returned when getting the
250 // localized string |message_id|. This is intended to be used in conjunction
251 // with field trials and the variations service to experiment with different
252 // UI strings.
253 void OverrideStringResource(int message_id,
254 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.
255
248 // Returns the full pathname of the locale file to load. May return an empty 256 // Returns the full pathname of the locale file to load. May return an empty
249 // string if no locale data files are found and |test_file_exists| is true. 257 // string if no locale data files are found and |test_file_exists| is true.
250 // Used on Android to load the local file in the browser process and pass it 258 // Used on Android to load the local file in the browser process and pass it
251 // to the sandboxed renderer process. 259 // to the sandboxed renderer process.
252 base::FilePath GetLocaleFilePath(const std::string& app_locale, 260 base::FilePath GetLocaleFilePath(const std::string& app_locale,
253 bool test_file_exists); 261 bool test_file_exists);
254 262
255 // Returns the maximum scale factor currently loaded. 263 // Returns the maximum scale factor currently loaded.
256 // Returns SCALE_FACTOR_100P if no resource is loaded. 264 // Returns SCALE_FACTOR_100P if no resource is loaded.
257 ScaleFactor GetMaxScaleFactor() const; 265 ScaleFactor GetMaxScaleFactor() const;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 scoped_ptr<gfx::FontList> small_font_list_; 392 scoped_ptr<gfx::FontList> small_font_list_;
385 scoped_ptr<gfx::FontList> small_bold_font_list_; 393 scoped_ptr<gfx::FontList> small_bold_font_list_;
386 scoped_ptr<gfx::FontList> medium_font_list_; 394 scoped_ptr<gfx::FontList> medium_font_list_;
387 scoped_ptr<gfx::FontList> medium_bold_font_list_; 395 scoped_ptr<gfx::FontList> medium_bold_font_list_;
388 scoped_ptr<gfx::FontList> large_font_list_; 396 scoped_ptr<gfx::FontList> large_font_list_;
389 scoped_ptr<gfx::FontList> large_bold_font_list_; 397 scoped_ptr<gfx::FontList> large_bold_font_list_;
390 scoped_ptr<gfx::FontList> web_font_list_; 398 scoped_ptr<gfx::FontList> web_font_list_;
391 399
392 base::FilePath overridden_pak_path_; 400 base::FilePath overridden_pak_path_;
393 401
402 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.
403
394 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 404 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
395 }; 405 };
396 406
397 } // namespace ui 407 } // namespace ui
398 408
399 // TODO(beng): Someday, maybe, get rid of this. 409 // TODO(beng): Someday, maybe, get rid of this.
400 using ui::ResourceBundle; 410 using ui::ResourceBundle;
401 411
402 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 412 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW
« 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