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

Unified Diff: ui/base/resource/resource_bundle_mac.mm

Issue 10686005: Add methods to add DataPack from open files (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/base/resource/resource_bundle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_mac.mm
diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm
index 75cf6463610c11dc7f8439cceee547677e1116ed..c18a7407203f2e3635c69dfe9903e81f533210a4 100644
--- a/ui/base/resource/resource_bundle_mac.mm
+++ b/ui/base/resource/resource_bundle_mac.mm
@@ -49,26 +49,27 @@ FilePath GetResourcesPakFilePath(NSString* name, NSString* mac_locale) {
} // namespace
void ResourceBundle::LoadCommonResources() {
- AddDataPack(GetResourcesPakFilePath(@"chrome", nil),
- SCALE_FACTOR_100P);
- AddDataPack(GetResourcesPakFilePath(@"theme_resources_standard", nil),
- SCALE_FACTOR_100P);
- AddDataPack(GetResourcesPakFilePath(@"ui_resources_standard", nil),
- SCALE_FACTOR_100P);
+ AddDataPackFromPath(GetResourcesPakFilePath(@"chrome", nil),
+ SCALE_FACTOR_100P);
+ AddDataPackFromPath(GetResourcesPakFilePath(@"theme_resources_standard", nil),
+ SCALE_FACTOR_100P);
+ AddDataPackFromPath(GetResourcesPakFilePath(@"ui_resources_standard", nil),
+ SCALE_FACTOR_100P);
// On Windows and ChromeOS we load either the 1x resource or the 2x resource.
// On Mac we load both and let the UI framework decide which one to use.
#if defined(ENABLE_HIDPI)
if (base::mac::IsOSLionOrLater()) {
- AddDataPack(GetResourcesPakFilePath(@"theme_resources_2x", nil),
- SCALE_FACTOR_200P);
- AddDataPack(GetResourcesPakFilePath(@"ui_resources_2x", nil),
- SCALE_FACTOR_200P);
+ AddDataPackFromPath(GetResourcesPakFilePath(@"theme_resources_2x", nil),
+ SCALE_FACTOR_200P);
+ AddDataPackFromPath(GetResourcesPakFilePath(@"ui_resources_2x", nil),
+ SCALE_FACTOR_200P);
}
#endif
}
-FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) {
+FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale,
+ bool test_file_exists) {
NSString* mac_locale = base::SysUTF8ToNSString(app_locale);
// Mac OS X uses "_" instead of "-", so swap to get a Mac-style value.
@@ -90,7 +91,7 @@ FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) {
if (locale_file_path.empty() || !locale_file_path.IsAbsolute())
return FilePath();
- if (!file_util::PathExists(locale_file_path))
+ if (test_file_exists && !file_util::PathExists(locale_file_path))
return FilePath();
return locale_file_path;
« no previous file with comments | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/base/resource/resource_bundle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698