| # Copyright 2014 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//chrome/browser/buildflags.gni") |
| import("//chrome/common/features.gni") |
| import("//components/compose/features.gni") |
| import("//components/enterprise/buildflags/buildflags.gni") |
| import("//content/browser/devtools/features.gni") |
| import("//pdf/features.gni") |
| import("//printing/buildflags/buildflags.gni") |
| import("//third_party/closure_compiler/compile_js.gni") |
| import("//tools/grit/grit_rule.gni") |
| import("//tools/grit/repack.gni") |
| import("//ui/webui/webui_features.gni") |
| |
| assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") |
| assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") |
| |
| group("resources") { |
| public_deps = [ |
| "connectors_internals:resources", |
| "saved_tab_groups_unsupported:resources", |
| "segmentation_internals:resources", |
| ] |
| |
| if (enable_extensions_core) { |
| public_deps += [ ":component_extension_resources" ] |
| } |
| |
| if (!is_android) { |
| public_deps += [ |
| ":app_icon_resources", |
| ":dev_ui_paks", |
| "about_sys:resources", |
| "access_code_cast:resources", |
| "actor_overlay:resources", |
| "app_service_internals:resources", |
| "autofill_ml_internals:resources", |
| "bookmarks:resources", |
| "certificate_manager:resources", |
| "commerce/product_specifications:resources", |
| "data_sharing:resources", |
| "downloads:resources", |
| "feedback:resources", |
| "gaia_auth_host:resources", |
| "history:resources", |
| "inspect:resources", |
| "key_value_pair_viewer_shared:resources", |
| "lens/overlay:resources", |
| "lens/shared:resources", |
| "management:resources", |
| "new_tab_footer:resources", |
| "new_tab_page:resources", |
| "new_tab_page/untrusted:resources", |
| "new_tab_page_instant:resources", |
| "new_tab_page_third_party:resources", |
| "new_tab_shared:resources", |
| "omnibox_popup:resources", |
| "password_manager:resources", |
| "privacy_sandbox:resources", |
| "privacy_sandbox/internals:resources", |
| "profile_internals:resources", |
| "search_engine_choice:resources", |
| "settings:resources", |
| "settings_shared:resources", |
| "side_panel/bookmarks:resources", |
| "side_panel/comments:resources", |
| "side_panel/commerce:resources", |
| "side_panel/customize_chrome:resources", |
| "side_panel/history:resources", |
| "side_panel/history_clusters:resources", |
| "side_panel/read_anything:resources", |
| "side_panel/reading_list:resources", |
| "side_panel/shared:resources", |
| "signin:resources", |
| "suggest_internals:resources", |
| "support_tool:resources", |
| "tab_group_home:resources", |
| "tab_search:resources", |
| "tab_strip_api:resources", |
| "web_app_internals:resources", |
| "webui_browser:resources", |
| "webui_gallery:resources", |
| "whats_new:resources", |
| ] |
| if (is_chrome_branded) { |
| public_deps += [ "media_router/cast_feedback:resources" ] |
| } |
| } |
| |
| if (is_chromeos) { |
| public_deps += [ |
| "ash/extended_updates:resources", |
| "ash/inline_login:resources", |
| "ash/settings:resources", |
| "chromeos:resources", |
| "chromeos/dlp_internals:resources", |
| ] |
| } |
| |
| if (enable_extensions) { |
| public_deps += [ |
| "accessibility:reading_mode_gdocs_extension_resources", |
| "extensions_zero_state_promo:resources", |
| ] |
| } |
| |
| if (is_mac) { |
| public_deps += [ |
| "//chrome/browser/resources/media/mei_preload:component", |
| "//components/privacy_sandbox/privacy_sandbox_attestations/preload:component", |
| ] |
| } |
| |
| if (is_win || is_mac || is_linux || is_chromeos || is_desktop_android) { |
| public_deps += [ "discards:resources" ] |
| } |
| |
| if (is_win || is_mac || is_linux) { |
| public_deps += [ |
| "app_home:resources", |
| "app_settings:resources", |
| "browser_switch:resources", |
| "on_device_translation_internals:resources", |
| "signin/history_sync_optin:resources", |
| ] |
| } |
| |
| if (!is_android && !is_chromeos) { |
| public_deps += [ |
| "inline_login:resources", |
| "signin/profile_picker:resources", |
| ] |
| } |
| |
| if (enable_dice_support) { |
| public_deps += [ |
| "intro:resources", |
| "signin/batch_upload:resources", |
| "signin/signout_confirmation:resources", |
| ] |
| } |
| |
| if (enable_webui_tab_strip) { |
| public_deps += [ "tab_strip:resources" ] |
| } |
| |
| if (enable_extensions_core) { |
| public_deps += [ "extensions:resources" ] |
| } |
| |
| if (enable_pdf) { |
| public_deps += [ "pdf:resources" ] |
| } |
| |
| if (enable_print_preview) { |
| if (is_chromeos) { |
| public_deps += [ "ash/print_preview:resources" ] |
| } else { |
| public_deps += [ "print_preview:resources" ] |
| } |
| } |
| |
| if (enable_webui_certificate_viewer) { |
| public_deps += [ "certificate_viewer:resources" ] |
| } |
| |
| if (enable_compose) { |
| public_deps += [ "compose:resources" ] |
| } |
| |
| if (enable_glic) { |
| public_deps += [ |
| "glic:resources", |
| "glic/fre:resources", |
| ] |
| } |
| |
| if (enterprise_watermark) { |
| public_deps += [ "watermark:resources" ] |
| } |
| } |
| |
| if (enable_webui_generate_code_cache) { |
| group("code_cache_resources") { |
| public_deps = [ |
| "side_panel/bookmarks:code_cache_resources", |
| "side_panel/customize_chrome:code_cache_resources", |
| "side_panel/reading_list:code_cache_resources", |
| "side_panel/shared:code_cache_resources", |
| ] |
| } |
| } |
| |
| if (is_chromeos && enable_js_type_check) { |
| group("closure_compile") { |
| deps = [ |
| "chromeos:closure_compile", |
| "chromeos/contact_center_insights:closure_compile", |
| "gaia_auth_host:closure_compile", |
| ] |
| } |
| } |
| |
| if (enable_extensions_core) { |
| grit("component_extension_resources") { |
| source = "component_extension_resources.grd" |
| |
| defines = chrome_grit_defines |
| if (enable_hangout_services_extension) { |
| defines += [ "enable_hangout_services_extension" ] |
| } |
| |
| # Some resources within component_extension_resources.grd are generated at |
| # build time so we include them as explicit dependencies here |
| if (is_chromeos) { |
| deps = [ |
| "chromeos/accessibility/braille_ime:ts_build", |
| "chromeos/contact_center_insights:generate_ccaas_deps", |
| "chromeos/desk_api:generate_desk_api_bundle", |
| ] |
| } |
| |
| outputs = [ |
| "grit/component_extension_resources.h", |
| "grit/component_extension_resources_map.cc", |
| "grit/component_extension_resources_map.h", |
| "component_extension_resources.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |
| } |
| |
| if (!is_android) { |
| grit("app_icon_resources") { |
| source = "app_icon/app_icon_resources.grd" |
| defines = chrome_grit_defines |
| outputs = [ |
| "grit/app_icon_resources.h", |
| "grit/app_icon_resources_map.cc", |
| "grit/app_icon_resources_map.h", |
| "app_icon_resources_100_percent.pak", |
| "app_icon_resources_200_percent.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |
| |
| if (is_chromeos) { |
| grit("office_web_app_resources") { |
| source = "office_web_app/resources.grd" |
| defines = chrome_grit_defines |
| outputs = [ |
| "grit/office_web_app_resources.h", |
| "grit/office_web_app_resources_map.cc", |
| "grit/office_web_app_resources_map.h", |
| "office_web_app_resources.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |
| } |
| |
| if (is_chrome_branded) { |
| grit("preinstalled_web_apps_resources") { |
| source = "preinstalled_web_apps/resources.grd" |
| defines = chrome_grit_defines |
| outputs = [ |
| "grit/preinstalled_web_apps_resources.h", |
| "grit/preinstalled_web_apps_resources_map.cc", |
| "grit/preinstalled_web_apps_resources_map.h", |
| "preinstalled_web_apps_resources.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |
| } |
| } |
| |
| group("dev_ui_resources") { |
| public_deps = [ |
| "accessibility:resources", |
| "bluetooth_internals:resources", |
| "browsing_topics:resources", |
| "components:resources", |
| "device_log:resources", |
| "engagement:resources", |
| "family_link_user_internals:resources", |
| "location_internals:resources", |
| "media:resources", |
| "memory_internals:resources", |
| "net_internals:resources", |
| "omnibox:resources", |
| "predictors:resources", |
| "privacy_sandbox/internals:resources", |
| "usb_internals:resources", |
| "//components/commerce/core/internals/resources", |
| "//components/data_sharing/data_sharing_internals/resources", |
| "//components/download/resources/download_internals:resources", |
| "//components/history_clusters/history_clusters_internals/resources", |
| "//components/metrics/debug:resources", |
| "//components/ntp_tiles/webui/resources", |
| "//components/optimization_guide/optimization_guide_internals/resources", |
| "//components/policy/resources/webui:resources", |
| "//components/resources:dev_ui_components_resources", |
| "//components/signin/core/browser/resources", |
| "//components/sync/service/resources", |
| "//components/ukm/debug:resources", |
| "//content/browser/resources/gpu:resources", |
| "//content/browser/resources/media:resources", |
| "//content/browser/resources/net:resources", |
| "//content/browser/resources/process:resources", |
| "//content/browser/resources/service_worker:resources", |
| "//content/browser/webrtc/resources", |
| ] |
| |
| if (enable_vr) { |
| public_deps += [ "//content/browser/resources/webxr_internals:resources" ] |
| } |
| |
| if (is_android) { |
| public_deps += [ |
| "//chrome/browser/resources/feed_internals:resources", |
| "//chrome/browser/resources/notifications_internals:resources", |
| "//chrome/browser/resources/webapks:resources", |
| ] |
| } else { |
| public_deps += [ |
| "actor_internals:resources", |
| "color_pipeline_internals:resources", |
| "infobar_internals:resources", |
| "media_router/internals:resources", |
| "on_device_internals:resources", |
| "user_education_internals:resources", |
| "webui_js_error:resources", |
| ] |
| } |
| |
| if (is_android || is_linux || is_chromeos || is_win) { |
| public_deps += [ "//chrome/browser/resources/sandbox_internals:resources" ] |
| } |
| |
| if (enable_session_service) { |
| public_deps += [ "tab_strip_internals:resources" ] |
| } |
| |
| if (enable_devtools_frontend) { |
| public_deps += [ "//content/browser/devtools:devtools_resources" ] |
| } |
| } |
| |
| repack("dev_ui_paks") { |
| output = "$root_gen_dir/chrome/dev_ui_resources.pak" |
| |
| sources = [ |
| "$root_gen_dir/chrome/accessibility_resources.pak", |
| "$root_gen_dir/chrome/bluetooth_internals_resources.pak", |
| "$root_gen_dir/chrome/browsing_topics_internals_resources.pak", |
| "$root_gen_dir/chrome/components_resources.pak", |
| "$root_gen_dir/chrome/device_log_resources.pak", |
| "$root_gen_dir/chrome/engagement_resources.pak", |
| "$root_gen_dir/chrome/family_link_user_internals_resources.pak", |
| "$root_gen_dir/chrome/location_internals_resources.pak", |
| "$root_gen_dir/chrome/media_resources.pak", |
| "$root_gen_dir/chrome/memory_internals_resources.pak", |
| "$root_gen_dir/chrome/net_internals_resources.pak", |
| "$root_gen_dir/chrome/omnibox_resources.pak", |
| "$root_gen_dir/chrome/predictors_resources.pak", |
| "$root_gen_dir/chrome/privacy_sandbox_internals_resources.pak", |
| "$root_gen_dir/chrome/usb_internals_resources.pak", |
| "$root_gen_dir/components/commerce_internals_resources.pak", |
| "$root_gen_dir/components/data_sharing_internals_resources.pak", |
| "$root_gen_dir/components/dev_ui_components_resources.pak", |
| "$root_gen_dir/components/download_internals_resources.pak", |
| "$root_gen_dir/components/history_clusters_internals_resources.pak", |
| "$root_gen_dir/components/metrics_internals_resources.pak", |
| "$root_gen_dir/components/ntp_tiles_internals_resources.pak", |
| "$root_gen_dir/components/optimization_guide_internals_resources.pak", |
| "$root_gen_dir/components/policy_resources.pak", |
| "$root_gen_dir/components/signin_internals_resources.pak", |
| "$root_gen_dir/components/sync_service_sync_internals_resources.pak", |
| "$root_gen_dir/components/ukm_resources.pak", |
| "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", |
| "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak", |
| "$root_gen_dir/content/gpu_resources.pak", |
| "$root_gen_dir/content/network_errors_resources.pak", |
| "$root_gen_dir/content/process_resources.pak", |
| "$root_gen_dir/content/service_worker_resources.pak", |
| ] |
| |
| if (enable_vr) { |
| sources += [ "$root_gen_dir/content/webxr_internals_resources.pak" ] |
| } |
| |
| if (is_android) { |
| sources += [ |
| "$root_gen_dir/chrome/feed_internals_resources.pak", |
| "$root_gen_dir/chrome/notifications_internals_resources.pak", |
| "$root_gen_dir/chrome/webapks_resources.pak", |
| ] |
| } else { |
| sources += [ |
| "$root_gen_dir/chrome/actor_internals_resources.pak", |
| "$root_gen_dir/chrome/color_pipeline_internals_resources.pak", |
| "$root_gen_dir/chrome/infobar_internals_resources.pak", |
| "$root_gen_dir/chrome/media_router_internals_resources.pak", |
| "$root_gen_dir/chrome/on_device_internals_resources.pak", |
| "$root_gen_dir/chrome/user_education_internals_resources.pak", |
| "$root_gen_dir/chrome/webui_js_error_resources.pak", |
| ] |
| } |
| |
| if (is_android || is_linux || is_chromeos || is_win) { |
| sources += [ "$root_gen_dir/chrome/sandbox_internals_resources.pak" ] |
| } |
| |
| if (enable_session_service) { |
| sources += [ "$root_gen_dir/chrome/tab_strip_internals_resources.pak" ] |
| } |
| |
| if (enable_devtools_frontend) { |
| sources += |
| [ "$root_gen_dir/content/browser/devtools/devtools_resources.pak" ] |
| } |
| |
| deps = [ ":dev_ui_resources" ] |
| } |