Chromium Code Reviews| 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 data->SetInteger("x_dpi", dpi.x()); | |
|
Wez
2012/07/19 01:00:42
nit: I was going to suggest only passing x_dpi and
Jamie
2012/07/19 23:00:06
Done.
| |
| 361 data->SetInteger("y_dpi", dpi.y()); | |
| 359 PostChromotingMessage("onDesktopSize", data.Pass()); | 362 PostChromotingMessage("onDesktopSize", data.Pass()); |
| 360 } | 363 } |
| 361 | 364 |
| 362 void ChromotingInstance::SetConnectionState( | 365 void ChromotingInstance::SetConnectionState( |
| 363 ConnectionState state, | 366 ConnectionState state, |
| 364 ConnectionError error) { | 367 ConnectionError error) { |
| 365 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 368 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 366 data->SetString("state", ConnectionStateToString(state)); | 369 data->SetString("state", ConnectionStateToString(state)); |
| 367 data->SetString("error", ConnectionErrorToString(error)); | 370 data->SetString("error", ConnectionErrorToString(error)); |
| 368 PostChromotingMessage("onConnectionStatus", data.Pass()); | 371 PostChromotingMessage("onConnectionStatus", data.Pass()); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 710 PostChromotingMessage("logDebugMessage", data.Pass()); | 713 PostChromotingMessage("logDebugMessage", data.Pass()); |
| 711 g_logging_to_plugin = false; | 714 g_logging_to_plugin = false; |
| 712 } | 715 } |
| 713 | 716 |
| 714 bool ChromotingInstance::IsConnected() { | 717 bool ChromotingInstance::IsConnected() { |
| 715 return host_connection_.get() && | 718 return host_connection_.get() && |
| 716 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 719 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
| 717 } | 720 } |
| 718 | 721 |
| 719 } // namespace remoting | 722 } // namespace remoting |
| OLD | NEW |