untrusted_bubble_web_ui_controller.cc 865 B

12345678910111213141516171819202122232425
  1. // Copyright 2022 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 "ui/webui/untrusted_bubble_web_ui_controller.h"
  5. #include "content/public/browser/web_ui.h"
  6. #include "content/public/common/bindings_policy.h"
  7. namespace ui {
  8. UntrustedBubbleWebUIController::UntrustedBubbleWebUIController(
  9. content::WebUI* web_ui,
  10. bool enable_chrome_send)
  11. : MojoBubbleWebUIController(web_ui, enable_chrome_send) {
  12. // chrome.send() will not work without bindings.
  13. CHECK(!enable_chrome_send);
  14. // UntrustedWebUIController should never enable WebUI bindings that expose
  15. // all of the browser interfaces.
  16. web_ui->SetBindings(content::BINDINGS_POLICY_NONE);
  17. }
  18. UntrustedBubbleWebUIController::~UntrustedBubbleWebUIController() = default;
  19. } // namespace ui