chromium/chrome/browser/ui/webui/certificate_manager/certificate_manager_ui.cc

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

#include "chrome/browser/ui/webui/certificate_manager/certificate_manager_ui.h"

#include <memory>

#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ui/webui/certificate_provisioning_ui_handler.h"
#include "chrome/browser/ui/webui/certificates_handler.h"
#include "components/user_manager/user_manager.h"
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

namespace {

const char kCRSLearnMoreLink[] =;

#if BUILDFLAG(IS_CHROMEOS_ASH)
void AddCertificateManagerStrings(content::WebUIDataSource* html_source) {
  struct {
    const char* name;
    int id;
  } localized_strings[] = {
      {"cancel", IDS_CANCEL},
      {"close", IDS_CLOSE},
      {"edit", IDS_SETTINGS_EDIT},
      {"moreActions", IDS_SETTINGS_MORE_ACTIONS},
      {"ok", IDS_OK},
  };
  for (const auto& entry : localized_strings) {
    html_source->AddLocalizedString(entry.name, entry.id);
  }
  certificate_manager::AddLocalizedStrings(html_source);
}
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
void AddCertificateManagerV2Strings(content::WebUIDataSource* html_source) {}
#endif  // BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)

}  // namespace

CertificateManagerUI::CertificateManagerUI(content::WebUI* web_ui)
#if BUILDFLAG(IS_CHROMEOS)
    :{}

#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
void CertificateManagerUI::BindInterface(
    mojo::PendingReceiver<
        certificate_manager_v2::mojom::CertificateManagerPageHandlerFactory>
        pending_receiver) {}

void CertificateManagerUI::CreateCertificateManagerPageHandler(
    mojo::PendingRemote<certificate_manager_v2::mojom::CertificateManagerPage>
        client,
    mojo::PendingReceiver<
        certificate_manager_v2::mojom::CertificateManagerPageHandler> handler) {}
#endif  // BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)

CertificateManagerUI::~CertificateManagerUI() = default;

WEB_UI_CONTROLLER_TYPE_IMPL(CertificateManagerUI)