From 6ac19647f2749d6f14b9558a8df0d5901e092772 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Thu, 13 Sep 2012 19:44:18 +0000 Subject: Always enabled audio in remoting host, disable it for It2Me, minor cleanups. It's not desired to have audio to be enabled by default in It2Me case. Specifically because in most cases helper and helpee will have separate audio channel (e.g. Hangout or Skype) that's connected before the session is started. Don't enable it until we have UI to toggle audio support. This change also includes some minor code cleanups. Review URL: https://chromiumcodereview.appspot.com/10928159 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156606 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/plugin/host_script_object.cc | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'remoting/host/plugin/host_script_object.cc') diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 7dd58f6b..c4989c6 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -580,7 +580,7 @@ void HostNPScriptObject::FinishConnect( network_settings.max_port = NetworkSettings::kDefaultMaxPort; } - // Create the Host. + // Create the host. host_ = new ChromotingHost( host_context_.get(), signal_strategy_.get(), desktop_environment_factory_.get(), @@ -589,17 +589,30 @@ void HostNPScriptObject::FinishConnect( host_->AddStatusObserver(this); log_to_server_.reset( new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); - base::Closure disconnect_callback = base::Bind( - &ChromotingHost::Shutdown, base::Unretained(host_.get()), - base::Closure()); - it2me_host_user_interface_->Start(host_.get(), disconnect_callback); - host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); + // Disable audio by default. + // TODO(sergeyu): Add UI to enable it. + scoped_ptr protocol_config = + protocol::CandidateSessionConfig::CreateDefault(); + protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get()); + host_->set_protocol_config(protocol_config.Pass()); + + // Provide localization strings to the host. { base::AutoLock auto_lock(ui_strings_lock_); host_->SetUiStrings(ui_strings_); } + // Create user interface. + base::Closure disconnect_callback = base::Bind( + &ChromotingHost::Shutdown, base::Unretained(host_.get()), + base::Closure()); + it2me_host_user_interface_->Start(host_.get(), disconnect_callback); + + // Create event logger. + host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); + + // Connect signaling and start the host. signal_strategy_->Connect(); host_->Start(uid); -- cgit v1.1