OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/webui/media/webrtc_logs_ui.h" | 5 #include "chrome/browser/ui/webui/media/webrtc_logs_ui.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #endif | 33 #endif |
34 | 34 |
35 using content::WebContents; | 35 using content::WebContents; |
36 using content::WebUIMessageHandler; | 36 using content::WebUIMessageHandler; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 content::WebUIDataSource* CreateWebRtcLogsUIHTMLSource() { | 40 content::WebUIDataSource* CreateWebRtcLogsUIHTMLSource() { |
41 content::WebUIDataSource* source = | 41 content::WebUIDataSource* source = |
42 content::WebUIDataSource::Create(chrome::kChromeUIWebRtcLogsHost); | 42 content::WebUIDataSource::Create(chrome::kChromeUIWebRtcLogsHost); |
43 source->SetUseJsonJSFormatV2(); | |
44 | 43 |
45 source->AddLocalizedString("webrtcLogsTitle", IDS_WEBRTC_LOGS_TITLE); | 44 source->AddLocalizedString("webrtcLogsTitle", IDS_WEBRTC_LOGS_TITLE); |
46 source->AddLocalizedString("webrtcLogCountFormat", | 45 source->AddLocalizedString("webrtcLogCountFormat", |
47 IDS_WEBRTC_LOGS_LOG_COUNT_BANNER_FORMAT); | 46 IDS_WEBRTC_LOGS_LOG_COUNT_BANNER_FORMAT); |
48 source->AddLocalizedString("webrtcLogHeaderFormat", | 47 source->AddLocalizedString("webrtcLogHeaderFormat", |
49 IDS_WEBRTC_LOGS_LOG_HEADER_FORMAT); | 48 IDS_WEBRTC_LOGS_LOG_HEADER_FORMAT); |
50 source->AddLocalizedString("webrtcLogLocalFileLabelFormat", | 49 source->AddLocalizedString("webrtcLogLocalFileLabelFormat", |
51 IDS_WEBRTC_LOGS_LOG_LOCAL_FILE_LABEL_FORMAT); | 50 IDS_WEBRTC_LOGS_LOG_LOCAL_FILE_LABEL_FORMAT); |
52 source->AddLocalizedString("webrtcLogLocalFileFormat", | 51 source->AddLocalizedString("webrtcLogLocalFileFormat", |
53 IDS_WEBRTC_LOGS_LOG_LOCAL_FILE_FORMAT); | 52 IDS_WEBRTC_LOGS_LOG_LOCAL_FILE_FORMAT); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // | 191 // |
193 /////////////////////////////////////////////////////////////////////////////// | 192 /////////////////////////////////////////////////////////////////////////////// |
194 | 193 |
195 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 194 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
196 Profile* profile = Profile::FromWebUI(web_ui); | 195 Profile* profile = Profile::FromWebUI(web_ui); |
197 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); | 196 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); |
198 | 197 |
199 // Set up the chrome://webrtc-logs/ source. | 198 // Set up the chrome://webrtc-logs/ source. |
200 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); | 199 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); |
201 } | 200 } |
OLD | NEW |