| 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 void* dst = array_buffer.Map(); | 622 void* dst = array_buffer.Map(); |
| 623 memcpy(dst, cursor_image->data(), buffer_size); | 623 memcpy(dst, cursor_image->data(), buffer_size); |
| 624 array_buffer.Unmap(); | 624 array_buffer.Unmap(); |
| 625 pp::VarDictionary dictionary; | 625 pp::VarDictionary dictionary; |
| 626 dictionary.Set(pp::Var("width"), width); | 626 dictionary.Set(pp::Var("width"), width); |
| 627 dictionary.Set(pp::Var("height"), height); | 627 dictionary.Set(pp::Var("height"), height); |
| 628 dictionary.Set(pp::Var("hotspotX"), cursor_hotspot.x()); | 628 dictionary.Set(pp::Var("hotspotX"), cursor_hotspot.x()); |
| 629 dictionary.Set(pp::Var("hotspotY"), cursor_hotspot.y()); | 629 dictionary.Set(pp::Var("hotspotY"), cursor_hotspot.y()); |
| 630 dictionary.Set(pp::Var("data"), array_buffer); | 630 dictionary.Set(pp::Var("data"), array_buffer); |
| 631 PostChromotingMessage("setCursorShape", dictionary); | 631 PostChromotingMessage("setCursorShape", dictionary); |
| 632 input_handler_.SetMouseCursor(scoped_ptr<pp::ImageData>(), cursor_hotspot); | 632 input_handler_.SetMouseCursor(nullptr, cursor_hotspot); |
| 633 } else { | 633 } else { |
| 634 if (delegate_large_cursors_) { | 634 if (delegate_large_cursors_) { |
| 635 pp::VarDictionary dictionary; | 635 pp::VarDictionary dictionary; |
| 636 PostChromotingMessage("unsetCursorShape", dictionary); | 636 PostChromotingMessage("unsetCursorShape", dictionary); |
| 637 } | 637 } |
| 638 input_handler_.SetMouseCursor(cursor_image.Pass(), cursor_hotspot); | 638 input_handler_.SetMouseCursor(cursor_image.Pass(), cursor_hotspot); |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 | 641 |
| 642 void ChromotingInstance::OnFirstFrameReceived() { | 642 void ChromotingInstance::OnFirstFrameReceived() { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 | 752 |
| 753 // Setup the signal strategy. | 753 // Setup the signal strategy. |
| 754 signal_strategy_.reset(new DelegatingSignalStrategy( | 754 signal_strategy_.reset(new DelegatingSignalStrategy( |
| 755 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, | 755 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, |
| 756 weak_factory_.GetWeakPtr()))); | 756 weak_factory_.GetWeakPtr()))); |
| 757 | 757 |
| 758 // Create TransportFactory. | 758 // Create TransportFactory. |
| 759 scoped_ptr<protocol::TransportFactory> transport_factory( | 759 scoped_ptr<protocol::TransportFactory> transport_factory( |
| 760 new protocol::LibjingleTransportFactory( | 760 new protocol::LibjingleTransportFactory( |
| 761 signal_strategy_.get(), | 761 signal_strategy_.get(), |
| 762 PepperPortAllocator::Create(this) | 762 PepperPortAllocator::Create(this).Pass(), |
| 763 .PassAs<cricket::HttpPortAllocatorBase>(), | |
| 764 protocol::NetworkSettings( | 763 protocol::NetworkSettings( |
| 765 protocol::NetworkSettings::NAT_TRAVERSAL_FULL))); | 764 protocol::NetworkSettings::NAT_TRAVERSAL_FULL))); |
| 766 | 765 |
| 767 // Create Authenticator. | 766 // Create Authenticator. |
| 768 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | 767 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
| 769 token_fetcher(new TokenFetcherProxy( | 768 token_fetcher(new TokenFetcherProxy( |
| 770 base::Bind(&ChromotingInstance::FetchThirdPartyToken, | 769 base::Bind(&ChromotingInstance::FetchThirdPartyToken, |
| 771 weak_factory_.GetWeakPtr()), | 770 weak_factory_.GetWeakPtr()), |
| 772 host_public_key)); | 771 host_public_key)); |
| 773 scoped_ptr<protocol::Authenticator> authenticator( | 772 scoped_ptr<protocol::Authenticator> authenticator( |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 void* data_ptr = array_buffer.Map(); | 1239 void* data_ptr = array_buffer.Map(); |
| 1241 memcpy(data_ptr, buffer, buffer_size); | 1240 memcpy(data_ptr, buffer, buffer_size); |
| 1242 array_buffer.Unmap(); | 1241 array_buffer.Unmap(); |
| 1243 pp::VarDictionary data_dictionary; | 1242 pp::VarDictionary data_dictionary; |
| 1244 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1243 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
| 1245 data_dictionary.Set(pp::Var("keyframe"), keyframe); | 1244 data_dictionary.Set(pp::Var("keyframe"), keyframe); |
| 1246 PostChromotingMessage("mediaSourceData", data_dictionary); | 1245 PostChromotingMessage("mediaSourceData", data_dictionary); |
| 1247 } | 1246 } |
| 1248 | 1247 |
| 1249 } // namespace remoting | 1248 } // namespace remoting |
| OLD | NEW |