CefPackResources
Header: cef_pack_resources.h
Category: System Utilities
Overview
Tasks, threads, parsers, streams, cookies, URL requests, scheme registration, and constant tables.
MacroGroup — Pack Resource ID Table (IDR_ constants)
Source File: include/cef_pack_resources.h
Process / Thread Context: Compile-time only (macro definitions).
Purpose: Generated by make_pack_header.py. Defines 962 #define IDR_* numeric constants for resources bundled into the CEF/Chromium resource pack (HTML, CSS, JS, image, JSON, manifest, lottie, flac, etc.). Numeric values are version-specific; use cef_id_for_pack_resource_name() (see cef_id_mappers.h) for version-safe lookups.
Notable Members
The file is organized into 26 sections, each beginning with // From <upstream>_resources.h:. The table below summarizes the major groups; constant counts are approximate (from the header) and reflect the full ID space for that source.
| Source section | Sample / representative constants | Purpose |
|---|---|---|
blink_image_resources.h | IDR_BROKENCANVAS (46390), IDR_BROKENIMAGE, IDR_SEARCH_CANCEL* | Blink image assets: broken-image and search-cancel icons (light/dark/HC modes). |
blink_resources.h | IDR_UASTYLE_HTML_CSS (46400), IDR_UASTYLE_*_CSS, IDR_PICKER_COMMON_JS, IDR_CALENDAR_PICKER_JS, IDR_PERMISSION_ICON_*_SVG | Blink UA stylesheets, form-picker JS/CSS, permission icons. |
browser_resources.h | IDR_INCOGNITO_TAB_HTML (15562), IDR_PDF_MANIFEST, IDR_WEBSTORE_MANIFEST, IDR_AUTOFILL_*_LOTTIE, IDR_INTRO_SOUND_*_FLAC | Browser-side HTML, manifests, Lottie animations, intro sounds. |
cef_resources.h | IDR_CEF_LICENSE_TXT (59090) | CEF-specific bundled resources (license text). |
common_resources.h | IDR_CHROME_EXTENSION_API_FEATURES (24200), IDR_CHROME_APP_API_FEATURES, IDR_CHROME_CONTROLLED_FRAME_API_FEATURES | Extension API feature definitions. |
component_extension_resources.h | IDR_NETWORK_SPEECH_SYNTHESIS_*, IDR_READING_MODE_GDOC_HELPER_*, IDR_GLIC_EXTENSION_* | Component-extension scripts (speech synthesis, reading mode, GLIC). |
components_resources.h | IDR_ABOUT_UI_CREDITS_*, IDR_DISTILLER_*, IDR_NET_ERROR_HTML (40599), IDR_SECURITY_INTERSTITIAL_* | Components-layer HTML/CSS/JS for credits, distiller, error pages, interstitials. |
content_resources.h | (small set) | Renderer/content-level resources. |
dev_ui_components_resources.h | (small set) | Developer-UI component resources. |
devtools_resources.h | (large set, lines 266–1196) | DevTools frontend images / scripts / Inspector resources. |
extensions_browser_resources.h | (small set) | Extension-browser-side resources. |
extensions_renderer_resources.h | (small set) | Extension-renderer-side resources. |
extensions_resources.h | (small set) | Misc extension resources. |
gpu_resources.h | (small set) | GPU-process resources. |
histograms_resources.h | (small set) | Histogram XML resources. |
mojo_bindings_resources.h | (small set) | Mojo bindings. |
net_resources.h | (small set) | Net-layer resources (e.g., IDR_DIR_HEADER_HTML). |
pdf_resources.h | (small set) | PDF viewer resources. |
process_resources.h | (small set) | Process-level resources. |
renderer_resources.h | (small set) | Renderer resources. |
service_worker_resources.h | (small set) | Service-worker resources. |
tracing_proto_resources.h | (small set) | Tracing proto resources. |
tracing_resources.h | (small set) | Tracing UI resources. |
ui_resources.h | IDR_CLOSE_*, IDR_DEFAULT_FAVICON*, IDR_FOLDER_*, IDR_SIGNAL_*_BAR, IDR_TOUCH_DRAG_TIP_* | Top-level Chrome UI assets: close buttons, favicons, folder icons, signal bars, drag tips. |
views_resources.h | IDR_APP_TOP_*, IDR_CLOSE*, IDR_MAXIMIZE*, IDR_MINIMIZE*, IDR_RESTORE*, IDR_TEXTBUTTON_HOVER_* | Views-framework frame and button bitmaps. |
webrtc_internals_resources.h | (small set) | WebRTC internals page assets. |
webui_resources.h | (set) | WebUI shared images / scripts. |
Usage Example
#include "include/cef_pack_resources.h"
#include "include/cef_id_mappers.h"
// Option A: hard-coded numeric value (version-specific).
CefRefPtr<CefResourceBundle> bundle = CefResourceBundle::GetGlobalBundle();
CefRefPtr<CefBinaryValue> license = bundle->GetDataResource(IDR_CEF_LICENSE_TXT);
// Option B: version-safe lookup at runtime.
CEF_DECLARE_PACK_RESOURCE_ID(IDR_CEF_LICENSE_TXT); // file-scope static
CefRefPtr<CefBinaryValue> license2 = bundle->GetDataResource(IDR_CEF_LICENSE_TXT);
// Option C: explicit resolver call.
int idr = cef_id_for_pack_resource_name("IDR_NET_ERROR_HTML");
if (idr != -1) { bundle->GetDataResource(idr); }