Skip to content

Commit

Permalink
Add chrome://process-internals support (see issue chromiumembedded#2498)
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenblatt committed Oct 4, 2019
1 parent eea1f6b commit 466f5e2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libcef/browser/net/chrome_scheme_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "cef/grit/cef_resources.h"
#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/browser/ui/webui/theme_source.h"
#include "chrome/common/url_constants.h"
#include "content/browser/frame_host/debug_urls.h"
#include "content/browser/webui/content_web_ui_controller_factory.h"
Expand Down Expand Up @@ -85,9 +86,11 @@ const char* kAllowedWebUIHosts[] = {
content::kChromeUINetworkErrorHost,
content::kChromeUINetworkErrorsListingHost,
chrome::kChromeUIPrintHost,
content::kChromeUIProcessInternalsHost,
content::kChromeUIResourcesHost,
content::kChromeUIServiceWorkerInternalsHost,
chrome::kChromeUISystemInfoHost,
chrome::kChromeUIThemeHost,
content::kChromeUITracingHost,
chrome::kChromeUIVersionHost,
content::kChromeUIWebRTCInternalsHost,
Expand All @@ -99,6 +102,7 @@ const char* kAllowedWebUIHosts[] = {
const char* kUnlistedHosts[] = {
content::kChromeUINetworkErrorHost,
content::kChromeUIResourcesHost,
chrome::kChromeUIThemeHost,
};

enum ChromeHostId {
Expand Down Expand Up @@ -536,6 +540,16 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
if (!AllowWebUIForURL(url))
return controller;

// Set up the chrome://theme/ source. These URLs are referenced from many
// places (WebUI and chrome://resources which live in //ui). WebUI code
// can live in both //content and //chrome. Since ThemeSource lives in
// //chrome the WebUI from //content is not performing this setup despite
// the fact that it's needed for proper handling of theme resource requests.
// See https://crbug.com/1011280.
Profile* profile = Profile::FromWebUI(web_ui);
content::URLDataSource::Add(profile,
std::make_unique<ThemeSource>(profile));

const auto host_id = GetChromeHostId(url.host());
if (host_id != CHROME_UNKNOWN) {
return std::make_unique<CefWebUIController>(web_ui, url.host(), host_id);
Expand Down

0 comments on commit 466f5e2

Please sign in to comment.