// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_WEBUI_CONFIG_H_ #define CONTENT_PUBLIC_BROWSER_WEBUI_CONFIG_H_ #include <memory> #include <string> #include <string_view> #include <type_traits> #include "content/common/content_export.h" #include "url/gurl.h" namespace content { class BrowserContext; class WebUIController; class WebUI; // Class that stores properties for a WebUI. // // Clients that implement WebUI pages subclass WebUIConfig, overload the // relevant methods and add an instance of their subclass to WebUIConfigMap. // // WebUIConfig is used when navigating to chrome:// or chrome-untrusted:// // pages to create the WebUIController and register the URLDataSource for // the WebUI. // // WebUI pages are currently being migrated to use WebUIConfig so not // all existing WebUI pages use this. class CONTENT_EXPORT WebUIConfig { … }; // Templated class with an implementation for CreateWebUIController. Prefer // to use this over WebUIConfig if the WebUIController can be created with // a single WebUI argument. template <typename T> class CONTENT_EXPORT DefaultWebUIConfig : public WebUIConfig { … }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_WEBUI_CONFIG_H_