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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 void ChromotingInstance::DidChangeView(const pp::View& view) { | 431 void ChromotingInstance::DidChangeView(const pp::View& view) { |
432 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 432 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
433 | 433 |
434 plugin_view_ = view; | 434 plugin_view_ = view; |
435 if (view_) { | 435 if (view_) { |
436 view_->SetView(view); | 436 view_->SetView(view); |
437 mouse_input_filter_.set_input_size(view_->get_view_size_dips()); | 437 mouse_input_filter_.set_input_size(view_->get_view_size_dips()); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 void ChromotingInstance::DidChangeFocus(bool has_focus) { | |
442 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | |
443 | |
444 input_handler_.OnFocusChanged(has_focus); | |
445 } | |
446 | |
447 bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { | 441 bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { |
448 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 442 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
449 | 443 |
450 if (!IsConnected()) | 444 if (!IsConnected()) |
451 return false; | 445 return false; |
452 | 446 |
453 return input_handler_.HandleInputEvent(event); | 447 return input_handler_.HandleInputEvent(event); |
454 } | 448 } |
455 | 449 |
456 void ChromotingInstance::SetDesktopSize(const SkISize& size, | 450 void ChromotingInstance::SetDesktopSize(const SkISize& size, |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 url_components.scheme.len); | 939 url_components.scheme.len); |
946 return url_scheme == kChromeExtensionUrlScheme; | 940 return url_scheme == kChromeExtensionUrlScheme; |
947 } | 941 } |
948 | 942 |
949 bool ChromotingInstance::IsConnected() { | 943 bool ChromotingInstance::IsConnected() { |
950 return host_connection_.get() && | 944 return host_connection_.get() && |
951 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 945 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
952 } | 946 } |
953 | 947 |
954 } // namespace remoting | 948 } // namespace remoting |
OLD | NEW |