Skip to content

Commit

Permalink
Merge pull request #14590 from electron/remove-gn-build-define
Browse files Browse the repository at this point in the history
chore: remove ELECTRON_GN_BUILD define
  • Loading branch information
nornagon committed Sep 12, 2018
2 parents e90c281 + 784c06c commit d78a2a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
5 changes: 0 additions & 5 deletions brightray/BUILD.gn
Expand Up @@ -16,11 +16,6 @@ static_library("brightray") {

include_dirs = [ ".." ]

defines = [
"DISABLE_NACL=1",
"ELECTRON_GN_BUILD",
]

if (is_linux) {
deps += [ "//build/config/linux/gtk" ]
}
Expand Down
29 changes: 3 additions & 26 deletions brightray/common/main_delegate.cc
Expand Up @@ -30,9 +30,6 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
#if defined(OS_MACOSX)
// Mac needs them too for scrollbar related images and for sandbox
// profiles.
#if !defined(DISABLE_NACL)
process_type == switches::kNaClLoaderProcess ||
#endif
process_type == switches::kPpapiPluginProcess ||
process_type == switches::kPpapiBrokerProcess ||
process_type == switches::kGpuProcess ||
Expand All @@ -57,40 +54,20 @@ void LoadResourceBundle(const std::string& locale) {
PathService::Get(base::DIR_MODULE, &pak_dir);
#endif

#if defined(ELECTRON_GN_BUILD)
ui::ResourceBundle::InitSharedInstanceWithLocale(
locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
bundle.ReloadLocaleResources(locale);
bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL("resources.pak")),
ui::SCALE_FACTOR_NONE);
#else
ui::ResourceBundle::InitSharedInstanceWithLocale(
locale, nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
bundle.ReloadLocaleResources(locale);

bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")),
ui::GetSupportedScaleFactors()[0]);
#if defined(ENABLE_PDF_VIEWER)
NOTIMPLEMENTED() << "Hi, whoever's fixing PDF support! Thanks! The pdf viewer "
"resources haven't been ported over to the GN build yet, so you'll "
"probably need to change this bit of code.";
bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")),
ui::GetSupportedScaleFactors()[0]);
#endif // defined(ENABLE_PDF_VIEWER)
bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL(
"blink_image_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("content_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("ui_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("views_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
#endif
}

MainDelegate::MainDelegate() {}
Expand Down

0 comments on commit d78a2a1

Please sign in to comment.