Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 10692179: Propagate connection state from networking layer to UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698