| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/string_util.h" | 11 #include "base/stringprintf.h" |
| 12 #include "base/task.h" | 12 #include "base/task.h" |
| 13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 // TODO(sergeyu): We should not depend on renderer here. Instead P2P | 14 // TODO(sergeyu): We should not depend on renderer here. Instead P2P |
| 15 // Pepper API should be used. Remove this dependency. | 15 // Pepper API should be used. Remove this dependency. |
| 16 // crbug.com/74951 | 16 // crbug.com/74951 |
| 17 #include "content/renderer/p2p/ipc_network_manager.h" | 17 #include "content/renderer/p2p/ipc_network_manager.h" |
| 18 #include "content/renderer/p2p/ipc_socket_factory.h" | 18 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 19 #include "ppapi/c/pp_input_event.h" | 19 #include "ppapi/c/pp_input_event.h" |
| 20 #include "ppapi/cpp/completion_callback.h" | 20 #include "ppapi/cpp/completion_callback.h" |
| 21 #include "ppapi/cpp/rect.h" | 21 #include "ppapi/cpp/rect.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // Default to a medium grey. | 106 // Default to a medium grey. |
| 107 view_->SetSolidFill(0xFFCDCDCD); | 107 view_->SetSolidFill(0xFFCDCDCD); |
| 108 | 108 |
| 109 return true; | 109 return true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void ChromotingInstance::Connect(const ClientConfig& config) { | 112 void ChromotingInstance::Connect(const ClientConfig& config) { |
| 113 DCHECK(CurrentlyOnPluginThread()); | 113 DCHECK(CurrentlyOnPluginThread()); |
| 114 | 114 |
| 115 LogDebugInfo(StringPrintf("Connecting to %s as %s", config.host_jid.c_str(), | 115 LogDebugInfo(base::StringPrintf("Connecting to %s as %s", |
| 116 config.username.c_str()).c_str()); | 116 config.host_jid.c_str(), |
| 117 config.username.c_str()).c_str()); |
| 117 client_.reset(new ChromotingClient(config, | 118 client_.reset(new ChromotingClient(config, |
| 118 &context_, | 119 &context_, |
| 119 host_connection_.get(), | 120 host_connection_.get(), |
| 120 view_proxy_, | 121 view_proxy_, |
| 121 rectangle_decoder_.get(), | 122 rectangle_decoder_.get(), |
| 122 input_handler_.get(), | 123 input_handler_.get(), |
| 123 NULL)); | 124 NULL)); |
| 124 | 125 |
| 125 // Kick off the connection. | 126 // Kick off the connection. |
| 126 client_->Start(); | 127 client_->Start(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return instance_object_; | 294 return instance_object_; |
| 294 } | 295 } |
| 295 | 296 |
| 296 ChromotingStats* ChromotingInstance::GetStats() { | 297 ChromotingStats* ChromotingInstance::GetStats() { |
| 297 if (!client_.get()) | 298 if (!client_.get()) |
| 298 return NULL; | 299 return NULL; |
| 299 return client_->GetStats(); | 300 return client_->GetStats(); |
| 300 } | 301 } |
| 301 | 302 |
| 302 } // namespace remoting | 303 } // namespace remoting |
| OLD | NEW |