Commit 502b2491 authored by Tommy Steimel's avatar Tommy Steimel Committed by Commit Bot

Kaleidoscope: Add WebUI logic directly to ChromeWebUIControllerFactory

This CL adds logic into ChromeWebUIControllerFactory for handling
Kaleidoscope URLs instead of using the
KaleidoscopeWebUIControllerFactory.

Bug: 1044741
Change-Id: I798b39fd8040f43fcfc1d841fea0f82fcf7985f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050032
Commit-Queue: Tommy Steimel <steimel@chromium.org>
Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741205}
parent 5bef0726
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_impl.h" #include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/chrome_browser_field_trials.h" #include "chrome/browser/chrome_browser_field_trials.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h" #include "chrome/browser/chrome_browser_main_extra_parts.h"
#include "chrome/browser/component_updater/registration.h" #include "chrome/browser/component_updater/registration.h"
...@@ -262,10 +261,6 @@ ...@@ -262,10 +261,6 @@
#include "extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.h" #include "extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS) #endif // BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_KALEIDOSCOPE)
#include "chrome/browser/media/kaleidoscope/internal/kaleidoscope_web_ui_controller_factory.h"
#endif // BUILDFLAG(ENABLE_KALEIDOSCOPE)
#if BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_NACL)
#include "components/nacl/browser/nacl_process_host.h" #include "components/nacl/browser/nacl_process_host.h"
#endif // BUILDFLAG(ENABLE_NACL) #endif // BUILDFLAG(ENABLE_NACL)
...@@ -1416,13 +1411,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { ...@@ -1416,13 +1411,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
content::WebUIControllerFactory::RegisterFactory( content::WebUIControllerFactory::RegisterFactory(
ChromeWebUIControllerFactory::GetInstance()); ChromeWebUIControllerFactory::GetInstance());
#if BUILDFLAG(ENABLE_KALEIDOSCOPE)
if (KaleidoscopeWebUIControllerFactory::IsEnabled()) {
content::WebUIControllerFactory::RegisterFactory(
KaleidoscopeWebUIControllerFactory::GetInstance());
}
#endif // BUILDFLAG(ENABLE_KALEIDOSCOPE)
#if BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_NACL)
// NaClBrowserDelegateImpl is accessed inside PostProfileInit(). // NaClBrowserDelegateImpl is accessed inside PostProfileInit().
// So make sure to create it before that. // So make sure to create it before that.
......
...@@ -99,6 +99,12 @@ ...@@ -99,6 +99,12 @@
#include "ui/web_dialogs/web_dialog_ui.h" #include "ui/web_dialogs/web_dialog_ui.h"
#include "url/gurl.h" #include "url/gurl.h"
#if BUILDFLAG(ENABLE_KALEIDOSCOPE)
#include "chrome/browser/media/kaleidoscope/internal/kaleidoscope_content_ui.h"
#include "chrome/browser/media/kaleidoscope/internal/kaleidoscope_ui.h"
#include "media/base/media_switches.h"
#endif // BUILDFLAG(ENABLE_KALEIDOSCOPE)
#if BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_NACL)
#include "chrome/browser/ui/webui/nacl_ui.h" #include "chrome/browser/ui/webui/nacl_ui.h"
#endif #endif
...@@ -669,6 +675,14 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -669,6 +675,14 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<WelcomeUI>; return &NewWebUI<WelcomeUI>;
#endif #endif
#if BUILDFLAG(ENABLE_KALEIDOSCOPE)
if (base::FeatureList::IsEnabled(media::kKaleidoscope)) {
if (url.host_piece() == chrome::kChromeUIKaleidoscopeHost)
return &NewWebUI<KaleidoscopeUI>;
if (url.host_piece() == chrome::kChromeUIKaleidoscopeContentHost)
return &NewWebUI<KaleidoscopeContentUI>;
}
#endif // BUILDFLAG(ENABLE_KALEIDOSCOPE)
#if BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_NACL)
if (url.host_piece() == chrome::kChromeUINaClHost) if (url.host_piece() == chrome::kChromeUINaClHost)
return &NewWebUI<NaClUI>; return &NewWebUI<NaClUI>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment