| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } else if (method == "onThirdPartyTokenFetched") { | 353 } else if (method == "onThirdPartyTokenFetched") { |
| 354 HandleOnThirdPartyTokenFetched(*data); | 354 HandleOnThirdPartyTokenFetched(*data); |
| 355 } else if (method == "requestPairing") { | 355 } else if (method == "requestPairing") { |
| 356 HandleRequestPairing(*data); | 356 HandleRequestPairing(*data); |
| 357 } else if (method == "extensionMessage") { | 357 } else if (method == "extensionMessage") { |
| 358 HandleExtensionMessage(*data); | 358 HandleExtensionMessage(*data); |
| 359 } else if (method == "allowMouseLock") { | 359 } else if (method == "allowMouseLock") { |
| 360 HandleAllowMouseLockMessage(); | 360 HandleAllowMouseLockMessage(); |
| 361 } else if (method == "enableMediaSourceRendering") { | 361 } else if (method == "enableMediaSourceRendering") { |
| 362 HandleEnableMediaSourceRendering(); | 362 HandleEnableMediaSourceRendering(); |
| 363 } else if (method == "sendMouseInputWhenUnfocused") { |
| 364 HandleSendMouseInputWhenUnfocused(); |
| 363 } | 365 } |
| 364 } | 366 } |
| 365 | 367 |
| 366 void ChromotingInstance::DidChangeFocus(bool has_focus) { | 368 void ChromotingInstance::DidChangeFocus(bool has_focus) { |
| 367 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 369 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
| 368 | 370 |
| 369 if (!IsConnected()) | 371 if (!IsConnected()) |
| 370 return; | 372 return; |
| 371 | 373 |
| 372 input_handler_.DidChangeFocus(has_focus); | 374 input_handler_.DidChangeFocus(has_focus); |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 } | 959 } |
| 958 | 960 |
| 959 void ChromotingInstance::HandleAllowMouseLockMessage() { | 961 void ChromotingInstance::HandleAllowMouseLockMessage() { |
| 960 input_handler_.AllowMouseLock(); | 962 input_handler_.AllowMouseLock(); |
| 961 } | 963 } |
| 962 | 964 |
| 963 void ChromotingInstance::HandleEnableMediaSourceRendering() { | 965 void ChromotingInstance::HandleEnableMediaSourceRendering() { |
| 964 use_media_source_rendering_ = true; | 966 use_media_source_rendering_ = true; |
| 965 } | 967 } |
| 966 | 968 |
| 969 void ChromotingInstance::HandleSendMouseInputWhenUnfocused() { |
| 970 input_handler_.set_send_mouse_input_when_unfocused(true); |
| 971 } |
| 972 |
| 967 ChromotingStats* ChromotingInstance::GetStats() { | 973 ChromotingStats* ChromotingInstance::GetStats() { |
| 968 if (!video_renderer_.get()) | 974 if (!video_renderer_.get()) |
| 969 return NULL; | 975 return NULL; |
| 970 return video_renderer_->GetStats(); | 976 return video_renderer_->GetStats(); |
| 971 } | 977 } |
| 972 | 978 |
| 973 void ChromotingInstance::PostChromotingMessage(const std::string& method, | 979 void ChromotingInstance::PostChromotingMessage(const std::string& method, |
| 974 const pp::VarDictionary& data) { | 980 const pp::VarDictionary& data) { |
| 975 pp::VarDictionary message; | 981 pp::VarDictionary message; |
| 976 message.Set(pp::Var("method"), pp::Var(method)); | 982 message.Set(pp::Var("method"), pp::Var(method)); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 pp::VarArrayBuffer array_buffer(buffer_size); | 1175 pp::VarArrayBuffer array_buffer(buffer_size); |
| 1170 void* data_ptr = array_buffer.Map(); | 1176 void* data_ptr = array_buffer.Map(); |
| 1171 memcpy(data_ptr, buffer, buffer_size); | 1177 memcpy(data_ptr, buffer, buffer_size); |
| 1172 array_buffer.Unmap(); | 1178 array_buffer.Unmap(); |
| 1173 pp::VarDictionary data_dictionary; | 1179 pp::VarDictionary data_dictionary; |
| 1174 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1180 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
| 1175 PostChromotingMessage("mediaSourceData", data_dictionary); | 1181 PostChromotingMessage("mediaSourceData", data_dictionary); |
| 1176 } | 1182 } |
| 1177 | 1183 |
| 1178 } // namespace remoting | 1184 } // namespace remoting |
| OLD | NEW |