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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 // TODO(wez): When we have a good hook into Host dimensions changes, move | 346 // TODO(wez): When we have a good hook into Host dimensions changes, move |
347 // this there. | 347 // this there. |
348 // If |input_handler_| is valid, then |mouse_input_filter_| must also be | 348 // If |input_handler_| is valid, then |mouse_input_filter_| must also be |
349 // since they are constructed together as part of the input pipeline | 349 // since they are constructed together as part of the input pipeline |
350 mouse_input_filter_->set_output_size(view_->get_screen_size()); | 350 mouse_input_filter_->set_output_size(view_->get_screen_size()); |
351 | 351 |
352 return input_handler_->HandleInputEvent(event); | 352 return input_handler_->HandleInputEvent(event); |
353 } | 353 } |
354 | 354 |
355 void ChromotingInstance::SetDesktopSize(int width, int height) { | 355 void ChromotingInstance::SetDesktopSize(const SkISize& size, |
| 356 const SkIPoint& dpi) { |
356 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 357 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
357 data->SetInteger("width", width); | 358 data->SetInteger("width", size.width()); |
358 data->SetInteger("height", height); | 359 data->SetInteger("height", size.height()); |
| 360 if (dpi.x()) |
| 361 data->SetInteger("x_dpi", dpi.x()); |
| 362 if (dpi.y()) |
| 363 data->SetInteger("y_dpi", dpi.y()); |
359 PostChromotingMessage("onDesktopSize", data.Pass()); | 364 PostChromotingMessage("onDesktopSize", data.Pass()); |
360 } | 365 } |
361 | 366 |
362 void ChromotingInstance::SetConnectionState( | 367 void ChromotingInstance::SetConnectionState( |
363 ConnectionState state, | 368 ConnectionState state, |
364 ConnectionError error) { | 369 ConnectionError error) { |
365 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 370 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
366 data->SetString("state", ConnectionStateToString(state)); | 371 data->SetString("state", ConnectionStateToString(state)); |
367 data->SetString("error", ConnectionErrorToString(error)); | 372 data->SetString("error", ConnectionErrorToString(error)); |
368 PostChromotingMessage("onConnectionStatus", data.Pass()); | 373 PostChromotingMessage("onConnectionStatus", data.Pass()); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 PostChromotingMessage("logDebugMessage", data.Pass()); | 715 PostChromotingMessage("logDebugMessage", data.Pass()); |
711 g_logging_to_plugin = false; | 716 g_logging_to_plugin = false; |
712 } | 717 } |
713 | 718 |
714 bool ChromotingInstance::IsConnected() { | 719 bool ChromotingInstance::IsConnected() { |
715 return host_connection_.get() && | 720 return host_connection_.get() && |
716 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 721 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
717 } | 722 } |
718 | 723 |
719 } // namespace remoting | 724 } // namespace remoting |
OLD | NEW |