system_extensions_internals_ui.cc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/webui/system_extensions_internals_ui/system_extensions_internals_ui.h"
  5. #include "ash/webui/grit/ash_system_extensions_internals_resources.h"
  6. #include "ash/webui/grit/ash_system_extensions_internals_resources_map.h"
  7. #include "ash/webui/system_extensions_internals_ui/url_constants.h"
  8. #include "content/public/browser/web_contents.h"
  9. #include "content/public/browser/web_ui.h"
  10. #include "content/public/browser/web_ui_data_source.h"
  11. #include "services/network/public/mojom/content_security_policy.mojom.h"
  12. #include "ui/webui/webui_allowlist.h"
  13. namespace ash {
  14. SystemExtensionsInternalsUI::SystemExtensionsInternalsUI(content::WebUI* web_ui)
  15. : ui::MojoWebUIController(web_ui) {
  16. content::WebUIDataSource* data_source =
  17. content::WebUIDataSource::CreateAndAdd(
  18. web_ui->GetWebContents()->GetBrowserContext(),
  19. kChromeUISystemExtensionsInternalsHost);
  20. data_source->AddResourcePath("",
  21. IDR_ASH_SYSTEM_EXTENSIONS_INTERNALS_INDEX_HTML);
  22. data_source->AddResourcePaths(
  23. base::make_span(kAshSystemExtensionsInternalsResources,
  24. kAshSystemExtensionsInternalsResourcesSize));
  25. }
  26. SystemExtensionsInternalsUI::~SystemExtensionsInternalsUI() = default;
  27. WEB_UI_CONTROLLER_TYPE_IMPL(SystemExtensionsInternalsUI)
  28. } // namespace ash