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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 done_event.Wait(); | 609 done_event.Wait(); |
610 client_.reset(); | 610 client_.reset(); |
611 } | 611 } |
612 | 612 |
613 // Disconnect the input pipeline and teardown the connection. | 613 // Disconnect the input pipeline and teardown the connection. |
614 mouse_input_filter_.set_input_stub(NULL); | 614 mouse_input_filter_.set_input_stub(NULL); |
615 host_connection_.reset(); | 615 host_connection_.reset(); |
616 } | 616 } |
617 | 617 |
618 void ChromotingInstance::OnIncomingIq(const std::string& iq) { | 618 void ChromotingInstance::OnIncomingIq(const std::string& iq) { |
619 xmpp_proxy_->OnIq(iq); | 619 // Just ignore the message if it's received before Connect() is called. |
alexeypa (please no reviews)
2013/04/08 15:55:29
nit: Add "It's likely to be a leftover from a prev
Sergey Ulanov
2013/04/08 19:48:12
Done.
| |
620 if (xmpp_proxy_) | |
621 xmpp_proxy_->OnIq(iq); | |
620 } | 622 } |
621 | 623 |
622 void ChromotingInstance::ReleaseAllKeys() { | 624 void ChromotingInstance::ReleaseAllKeys() { |
623 if (IsConnected()) | 625 if (IsConnected()) |
624 input_tracker_.ReleaseAll(); | 626 input_tracker_.ReleaseAll(); |
625 } | 627 } |
626 | 628 |
627 void ChromotingInstance::InjectKeyEvent(const protocol::KeyEvent& event) { | 629 void ChromotingInstance::InjectKeyEvent(const protocol::KeyEvent& event) { |
628 // Inject after the KeyEventMapper, so the event won't get mapped or trapped. | 630 // Inject after the KeyEventMapper, so the event won't get mapped or trapped. |
629 if (IsConnected()) | 631 if (IsConnected()) |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 url_components.scheme.len); | 869 url_components.scheme.len); |
868 return url_scheme == kChromeExtensionUrlScheme; | 870 return url_scheme == kChromeExtensionUrlScheme; |
869 } | 871 } |
870 | 872 |
871 bool ChromotingInstance::IsConnected() { | 873 bool ChromotingInstance::IsConnected() { |
872 return host_connection_.get() && | 874 return host_connection_.get() && |
873 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 875 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
874 } | 876 } |
875 | 877 |
876 } // namespace remoting | 878 } // namespace remoting |
OLD | NEW |