1 // Copyright (c) 2013 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.
5 #include "content/browser/media/webrtc_internals_ui.h"
7 #include "content/browser/media/webrtc_internals_message_handler.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 "content/public/common/url_constants.h"
12 #include "grit/content_resources.h"
17 WebUIDataSource
* CreateWebRTCInternalsHTMLSource() {
18 WebUIDataSource
* source
=
19 WebUIDataSource::Create(kChromeUIWebRTCInternalsHost
);
21 source
->SetJsonPath("strings.js");
22 source
->AddResourcePath("webrtc_internals.js", IDR_WEBRTC_INTERNALS_JS
);
23 source
->SetDefaultResource(IDR_WEBRTC_INTERNALS_HTML
);
29 ////////////////////////////////////////////////////////////////////////////////
33 ////////////////////////////////////////////////////////////////////////////////
35 WebRTCInternalsUI::WebRTCInternalsUI(WebUI
* web_ui
)
36 : WebUIController(web_ui
) {
37 web_ui
->AddMessageHandler(new WebRTCInternalsMessageHandler());
39 BrowserContext
* browser_context
=
40 web_ui
->GetWebContents()->GetBrowserContext();
41 WebUIDataSource::Add(browser_context
, CreateWebRTCInternalsHTMLSource());
44 } // namespace content