diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 2abfbcb71c..5f94601be9 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -7,6 +7,7 @@ #include #include "base/command_line.h" +#include "base/mac/bundle_locations.h" #include "base/path_service.h" #include "brightray/browser/browser_client.h" #include "brightray/common/content_client.h" @@ -53,12 +54,13 @@ void LoadResourceBundle(const std::string& locale) { ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); bundle.ReloadLocaleResources(locale); -// Load other resource files. -#if defined(OS_MACOSX) - LoadCommonResources(); -#else + // Load other resource files. base::FilePath pak_dir; +#if defined(OS_MACOSX) + pak_dir = base::mac::FrameworkBundlePath().Append("Resources"); +#else PathService::Get(base::DIR_MODULE, &pak_dir); +#endif bundle.AddDataPackFromPath( pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")), ui::GetSupportedScaleFactors()[0]); @@ -79,7 +81,6 @@ void LoadResourceBundle(const std::string& locale) { bundle.AddDataPackFromPath( pak_dir.Append(FILE_PATH_LITERAL("views_resources_200_percent.pak")), ui::SCALE_FACTOR_200P); -#endif } MainDelegate::MainDelegate() {} diff --git a/brightray/common/main_delegate_mac.mm b/brightray/common/main_delegate_mac.mm index b0a3065276..7f982647c5 100644 --- a/brightray/common/main_delegate_mac.mm +++ b/brightray/common/main_delegate_mac.mm @@ -25,23 +25,8 @@ base::FilePath GetFrameworksPath() { return MainApplicationBundlePath().Append("Contents").Append("Frameworks"); } -base::FilePath GetResourcesPakFilePath(NSString* name) { - auto path = [base::mac::FrameworkBundle() pathForResource:name ofType:@"pak"]; - return base::mac::NSStringToFilePath(path); -} - } // namespace -void LoadCommonResources() { - ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); - bundle.AddDataPackFromPath(GetResourcesPakFilePath(@"content_shell"), - ui::GetSupportedScaleFactors()[0]); -#if defined(ENABLE_PDF_VIEWER) - bundle.AddDataPackFromPath(GetResourcesPakFilePath(@"pdf_viewer_resources"), - ui::GetSupportedScaleFactors()[0]); -#endif // defined(ENABLE_PDF_VIEWER) -} - void MainDelegate::OverrideFrameworkBundlePath() { base::FilePath helper_path = GetFrameworksPath().Append(GetApplicationName() + " Framework.framework"); diff --git a/electron.gyp b/electron.gyp index b06a3b7123..2ba2038c99 100644 --- a/electron.gyp +++ b/electron.gyp @@ -638,8 +638,12 @@ 'mac_bundle': 1, 'mac_bundle_resources': [ 'atom/common/resources/mac/MainMenu.xib', - '<(libchromiumcontent_dir)/content_shell.pak', '<(libchromiumcontent_dir)/icudtl.dat', + '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak', + '<(libchromiumcontent_dir)/content_resources_200_percent.pak', + '<(libchromiumcontent_dir)/content_shell.pak', + '<(libchromiumcontent_dir)/ui_resources_200_percent.pak', + '<(libchromiumcontent_dir)/views_resources_200_percent.pak', '<(libchromiumcontent_dir)/natives_blob.bin', '<(libchromiumcontent_dir)/snapshot_blob.bin', ],