| 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 386 |
| 387 void ChromotingInstance::OnConnectionState( | 387 void ChromotingInstance::OnConnectionState( |
| 388 protocol::ConnectionToHost::State state, | 388 protocol::ConnectionToHost::State state, |
| 389 protocol::ErrorCode error) { | 389 protocol::ErrorCode error) { |
| 390 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 390 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 391 data->SetString("state", ConnectionStateToString(state)); | 391 data->SetString("state", ConnectionStateToString(state)); |
| 392 data->SetString("error", ConnectionErrorToString(error)); | 392 data->SetString("error", ConnectionErrorToString(error)); |
| 393 PostChromotingMessage("onConnectionStatus", data.Pass()); | 393 PostChromotingMessage("onConnectionStatus", data.Pass()); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void ChromotingInstance::OnConnectionReady(bool ready) { |
| 397 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 398 data->SetBoolean("ready", ready); |
| 399 PostChromotingMessage("onConnectionReady", data.Pass()); |
| 400 } |
| 401 |
| 396 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { | 402 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { |
| 397 // TODO(sergeyu): Move clipboard handling to a separate class. | 403 // TODO(sergeyu): Move clipboard handling to a separate class. |
| 398 // crbug.com/138108 | 404 // crbug.com/138108 |
| 399 return this; | 405 return this; |
| 400 } | 406 } |
| 401 | 407 |
| 402 protocol::CursorShapeStub* ChromotingInstance::GetCursorShapeStub() { | 408 protocol::CursorShapeStub* ChromotingInstance::GetCursorShapeStub() { |
| 403 // TODO(sergeyu): Move cursor shape code to a separate class. | 409 // TODO(sergeyu): Move cursor shape code to a separate class. |
| 404 // crbug.com/138108 | 410 // crbug.com/138108 |
| 405 return this; | 411 return this; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 PostChromotingMessage("logDebugMessage", data.Pass()); | 751 PostChromotingMessage("logDebugMessage", data.Pass()); |
| 746 g_logging_to_plugin = false; | 752 g_logging_to_plugin = false; |
| 747 } | 753 } |
| 748 | 754 |
| 749 bool ChromotingInstance::IsConnected() { | 755 bool ChromotingInstance::IsConnected() { |
| 750 return host_connection_.get() && | 756 return host_connection_.get() && |
| 751 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 757 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
| 752 } | 758 } |
| 753 | 759 |
| 754 } // namespace remoting | 760 } // namespace remoting |
| OLD | NEW |