blob: 96917ca32e9b1bd3dd715836ec861f491dbffe98 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2013 The Chromium Authors
[email protected]64ccac32013-01-29 21:40:042// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
mcasas6b8c0c82016-07-29 23:04:355#include "content/browser/webrtc/webrtc_internals_ui.h"
[email protected]64ccac32013-01-29 21:40:046
Christopher Grant898f6842019-10-24 17:03:067#include "content/browser/webrtc/resources/grit/webrtc_internals_resources.h"
rbpotter5796b002021-03-10 18:49:218#include "content/browser/webrtc/resources/grit/webrtc_internals_resources_map.h"
mcasas6b8c0c82016-07-29 23:04:359#include "content/browser/webrtc/webrtc_internals_message_handler.h"
[email protected]64ccac32013-01-29 21:40:0410#include "content/public/browser/web_contents.h"
11#include "content/public/browser/web_ui.h"
12#include "content/public/browser/web_ui_data_source.h"
13#include "content/public/common/url_constants.h"
[email protected]64ccac32013-01-29 21:40:0414
15namespace content {
16namespace {
17
Lei Zhang4fcf8402023-03-17 22:58:5118void CreateAndAddWebRTCInternalsHTMLSource(BrowserContext* browser_context) {
19 WebUIDataSource* source = WebUIDataSource::CreateAndAdd(
20 browser_context, kChromeUIWebRTCInternalsHost);
[email protected]64ccac32013-01-29 21:40:0421
Dan Beame9f4007f2019-08-17 00:59:1022 source->UseStringsJs();
Peter Kasting5f6928c2024-11-29 21:25:1123 source->AddResourcePaths(kWebrtcInternalsResources);
rbpotter5796b002021-03-10 18:49:2124 source->SetDefaultResource(IDR_WEBRTC_INTERNALS_WEBRTC_INTERNALS_HTML);
[email protected]64ccac32013-01-29 21:40:0425}
26
27} // namespace
28
29////////////////////////////////////////////////////////////////////////////////
30//
31// WebRTCInternalsUI
32//
33////////////////////////////////////////////////////////////////////////////////
34
35WebRTCInternalsUI::WebRTCInternalsUI(WebUI* web_ui)
36 : WebUIController(web_ui) {
Jeremy Roman04f27c372017-10-27 15:20:5537 web_ui->AddMessageHandler(std::make_unique<WebRTCInternalsMessageHandler>());
[email protected]64ccac32013-01-29 21:40:0438
Lei Zhang4fcf8402023-03-17 22:58:5139 CreateAndAddWebRTCInternalsHTMLSource(
40 web_ui->GetWebContents()->GetBrowserContext());
[email protected]64ccac32013-01-29 21:40:0441}
42
43} // namespace content