Location of chrome:// pages in src code

104 views
Skip to first unread message

NG

unread,
Jun 15, 2022, 7:03:59 PM6/15/22
to Chromium-dev
Hi,
I'm working on my own chromium build, and I want to be able to customize the chrome:// pages, specifically the chrome://settings pages, but I'm having trouble finding where the pages or the code that generates them are in the chromium source code.  Can someone please direct me to their location?
Thanks a lot!

Eric Willigers

unread,
Jun 15, 2022, 9:40:26 PM6/15/22
to Chromium-dev, NG
> I'm having trouble finding where the pages or the code that generates them are in the chromium source code.

To find the answer to your question, let's choose one of the less well known chrome:// pages and search for where it is referenced in the code base.

chrome/browser/flag_descriptions.cc mentions a few, e.g.  
  • chrome://media-internals
  • chrome://net-internals
  • chrome://memory-internals
  • chrome://web-app-internals
  • chrome://process-internals

We might then search for one of these in the codebase, and use git blame to find the commit where they were added to the codebase.

For example, a search for web-app-internals leads to
chrome/common/webui_url_constants.cc:const char kChromeUIWebAppInternalsHost[] = "web-app-internals";
introduced in commit 919b4590d9c960 crrev.com/c/2999153


Who calls that?  URLDataManager::AddDataSource(), which is called by URLDataSource::Add(), which is called all over the place as the various chrome:// pages such as Settings are added.

Now we have a starting point for exploration of the Settings implementation.



Demetrios Papadopoulos

unread,
Jun 16, 2022, 1:57:24 PM6/16/22
to ericwi...@chromium.org, Chromium-dev, NG
Most chrome:// pages frontend code resides under chrome/browser/resources/. Settings specifically resides under chrome/browser/resources/settings.

Hope this helps.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/fb12567f-321c-4afe-b36d-55054d377349n%40chromium.org.

NG

unread,
Jun 20, 2022, 9:25:00 PM6/20/22
to Chromium-dev, dpapad, Chromium-dev, NG, ericwi...@chromium.org
Thank you very much for your help!  (sorry for the late response.)
Reply all
Reply to author
Forward
0 new messages