chromium/chrome/browser/ui/webui/about/about_ui.h

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_WEBUI_ABOUT_ABOUT_UI_H_
#define CHROME_BROWSER_UI_WEBUI_ABOUT_ABOUT_UI_H_

#include <memory>
#include <string>
#include <string_view>

#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/webui_config.h"

class AboutUI;
class Profile;

namespace content {
class WebUI;
}  // namespace content

// AboutUI is used by multiple chrome:// pages.

class AboutUIConfigBase : public content::DefaultWebUIConfig<AboutUI> {};

// chrome://chrome-urls. Note that HandleChromeAboutAndChromeSyncRewrite()
// rewrites chrome://about -> chrome://chrome-urls.
class ChromeURLsUIConfig : public AboutUIConfigBase {};

// chrome://credits.
class CreditsUIConfig : public AboutUIConfigBase {};

#if !BUILDFLAG(IS_ANDROID)
// chrome://terms
class TermsUIConfig : public AboutUIConfigBase {};
#endif

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
// chrome://linux-proxy-config
class LinuxProxyConfigUI : public AboutUIConfigBase {};
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH)
// chrome://os-credits
class OSCreditsUI : public AboutUIConfigBase {
 public:
  OSCreditsUI();
};

// chrome://borealis-credits
class BorealisCreditsUI : public AboutUIConfigBase {
 public:
  BorealisCreditsUI();
};

// chrome://crostini-credits
class CrostiniCreditsUI : public AboutUIConfigBase {
 public:
  CrostiniCreditsUI();
};
#endif

// We expose this class because the OOBE flow may need to explicitly add the
// chrome://terms source outside of the normal flow.
class AboutUIHTMLSource : public content::URLDataSource {};

class AboutUI : public content::WebUIController {};

namespace about_ui {

// Helper functions
void AppendHeader(std::string* output, const std::string& unescaped_title);
void AppendBody(std::string *output);
void AppendFooter(std::string *output);

}  // namespace about_ui

#endif  // CHROME_BROWSER_UI_WEBUI_ABOUT_ABOUT_UI_H_