| 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/media/webrtc/webrtc_internals_message_handler.h" | 5 #include "content/browser/media/webrtc/webrtc_internals_message_handler.h" |
| 6 | 6 |
| 7 #include "content/browser/media/webrtc/webrtc_internals.h" | 7 #include "content/browser/media/webrtc/webrtc_internals.h" |
| 8 #include "content/common/media/peer_connection_tracker_messages.h" | 8 #include "content/common/media/peer_connection_tracker_messages.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 WebRTCInternals::GetInstance()->EnableAudioDebugRecordings( | 87 WebRTCInternals::GetInstance()->EnableAudioDebugRecordings( |
| 88 web_ui()->GetWebContents()); | 88 web_ui()->GetWebContents()); |
| 89 } else { | 89 } else { |
| 90 WebRTCInternals::GetInstance()->DisableAudioDebugRecordings(); | 90 WebRTCInternals::GetInstance()->DisableAudioDebugRecordings(); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void WebRTCInternalsMessageHandler::OnSetEventLogRecordingsEnabled( | 94 void WebRTCInternalsMessageHandler::OnSetEventLogRecordingsEnabled( |
| 95 bool enable, | 95 bool enable, |
| 96 const base::ListValue* /* unused_list */) { | 96 const base::ListValue* /* unused_list */) { |
| 97 WebRTCInternals::GetInstance()->SetEventLogRecordings( | 97 if (enable) { |
| 98 enable, enable ? web_ui()->GetWebContents() : nullptr); | 98 WebRTCInternals::GetInstance()->EnableEventLogRecordings( |
| 99 web_ui()->GetWebContents()); |
| 100 } else { |
| 101 WebRTCInternals::GetInstance()->DisableEventLogRecordings(); |
| 102 } |
| 99 } | 103 } |
| 100 | 104 |
| 101 void WebRTCInternalsMessageHandler::OnDOMLoadDone( | 105 void WebRTCInternalsMessageHandler::OnDOMLoadDone( |
| 102 const base::ListValue* /* unused_list */) { | 106 const base::ListValue* /* unused_list */) { |
| 103 WebRTCInternals::GetInstance()->UpdateObserver(this); | 107 WebRTCInternals::GetInstance()->UpdateObserver(this); |
| 104 | 108 |
| 105 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { | 109 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { |
| 106 RenderFrameHost* host = GetWebRTCInternalsHost(); | 110 RenderFrameHost* host = GetWebRTCInternalsHost(); |
| 107 if (!host) | 111 if (!host) |
| 108 return; | 112 return; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 124 | 128 |
| 125 std::vector<const base::Value*> args_vector; | 129 std::vector<const base::Value*> args_vector; |
| 126 if (args) | 130 if (args) |
| 127 args_vector.push_back(args); | 131 args_vector.push_back(args); |
| 128 | 132 |
| 129 base::string16 update = WebUI::GetJavascriptCall(command, args_vector); | 133 base::string16 update = WebUI::GetJavascriptCall(command, args_vector); |
| 130 host->ExecuteJavaScript(update); | 134 host->ExecuteJavaScript(update); |
| 131 } | 135 } |
| 132 | 136 |
| 133 } // namespace content | 137 } // namespace content |
| OLD | NEW |