OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/webrtc/webrtc_internals_ui.h" | 5 #include "content/browser/webrtc/webrtc_internals_ui.h" |
6 | 6 |
7 #include "content/browser/webrtc/webrtc_internals_message_handler.h" | 7 #include "content/browser/webrtc/webrtc_internals_message_handler.h" |
8 #include "content/grit/content_resources.h" | 8 #include "content/grit/content_resources.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
11 #include "content/public/browser/web_ui_data_source.h" | 11 #include "content/public/browser/web_ui_data_source.h" |
12 #include "content/public/common/url_constants.h" | 12 #include "content/public/common/url_constants.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 namespace { | 15 namespace { |
16 | 16 |
17 WebUIDataSource* CreateWebRTCInternalsHTMLSource() { | 17 WebUIDataSource* CreateWebRTCInternalsHTMLSource() { |
18 WebUIDataSource* source = | 18 WebUIDataSource* source = |
19 WebUIDataSource::Create(kChromeUIWebRTCInternalsHost); | 19 WebUIDataSource::Create(kChromeUIWebRTCInternalsHost); |
20 | 20 |
21 source->SetJsonPath("strings.js"); | 21 source->SetJsonPath("strings.js"); |
22 source->AddResourcePath("webrtc_internals.js", IDR_WEBRTC_INTERNALS_JS); | 22 source->AddResourcePath("webrtc_internals.js", IDR_WEBRTC_INTERNALS_JS); |
23 source->SetDefaultResource(IDR_WEBRTC_INTERNALS_HTML); | 23 source->SetDefaultResource(IDR_WEBRTC_INTERNALS_HTML); |
24 source->DisableI18nAndUseGzipForAllPaths(); | 24 source->UseGzip(std::unordered_set<std::string>()); |
25 return source; | 25 return source; |
26 } | 26 } |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
31 // | 31 // |
32 // WebRTCInternalsUI | 32 // WebRTCInternalsUI |
33 // | 33 // |
34 //////////////////////////////////////////////////////////////////////////////// | 34 //////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
36 WebRTCInternalsUI::WebRTCInternalsUI(WebUI* web_ui) | 36 WebRTCInternalsUI::WebRTCInternalsUI(WebUI* web_ui) |
37 : WebUIController(web_ui) { | 37 : WebUIController(web_ui) { |
38 web_ui->AddMessageHandler(new WebRTCInternalsMessageHandler()); | 38 web_ui->AddMessageHandler(new WebRTCInternalsMessageHandler()); |
39 | 39 |
40 BrowserContext* browser_context = | 40 BrowserContext* browser_context = |
41 web_ui->GetWebContents()->GetBrowserContext(); | 41 web_ui->GetWebContents()->GetBrowserContext(); |
42 WebUIDataSource::Add(browser_context, CreateWebRTCInternalsHTMLSource()); | 42 WebUIDataSource::Add(browser_context, CreateWebRTCInternalsHTMLSource()); |
43 } | 43 } |
44 | 44 |
45 } // namespace content | 45 } // namespace content |
OLD | NEW |