Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 11192042: Protocol plumbing for audio toggle. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/host/client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index db90e9afefcca360aa06340e3119e81e3ab17ce9..362b11c644b692703ce1e301eae8bc4f6385bc8e 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -126,7 +126,7 @@ logging::LogMessageHandlerFunction g_logging_old_handler = NULL;
// String sent in the "hello" message to the plugin to describe features.
const char ChromotingInstance::kApiFeatures[] =
"highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey "
- "notifyClientDimensions pauseVideo";
+ "notifyClientDimensions pauseVideo pauseAudio";
bool ChromotingInstance::ParseAuthMethods(const std::string& auth_methods_str,
ClientConfig* config) {
@@ -345,6 +345,13 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
return;
}
PauseVideo(pause);
+ } else if (method == "pauseAudio") {
+ bool pause = false;
+ if (!data->GetBoolean("pause", &pause)) {
+ LOG(ERROR) << "Invalid pauseAudio.";
+ return;
+ }
+ PauseAudio(pause);
}
}
@@ -580,6 +587,15 @@ void ChromotingInstance::PauseVideo(bool pause) {
host_connection_->host_stub()->ControlVideo(video_control);
}
+void ChromotingInstance::PauseAudio(bool pause) {
+ if (!IsConnected()) {
+ return;
+ }
+ protocol::AudioControl audio_control;
+ audio_control.set_enable(!pause);
+ host_connection_->host_stub()->ControlAudio(audio_control);
+}
+
ChromotingStats* ChromotingInstance::GetStats() {
if (!client_.get())
return NULL;
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/host/client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698