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

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

Issue 126123002: Show connection type in web-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing Android implementation. Created 6 years, 11 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 data->SetString("scope", scope); 429 data->SetString("scope", scope);
430 PostChromotingMessage("fetchThirdPartyToken", data.Pass()); 430 PostChromotingMessage("fetchThirdPartyToken", data.Pass());
431 } 431 }
432 432
433 void ChromotingInstance::OnConnectionReady(bool ready) { 433 void ChromotingInstance::OnConnectionReady(bool ready) {
434 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 434 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
435 data->SetBoolean("ready", ready); 435 data->SetBoolean("ready", ready);
436 PostChromotingMessage("onConnectionReady", data.Pass()); 436 PostChromotingMessage("onConnectionReady", data.Pass());
437 } 437 }
438 438
439 void ChromotingInstance::OnRouteChanged(const std::string& channel_name,
440 const protocol::TransportRoute& route) {
441 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
442 std::string message = "Channel " + channel_name + " using " +
443 protocol::TransportRoute::GetTypeString(route.type) + " connection.";
444 data->SetString("message", message);
445 PostChromotingMessage("logDebugMessage", data.Pass());
446 }
447
439 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { 448 void ChromotingInstance::SetCapabilities(const std::string& capabilities) {
440 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 449 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
441 data->SetString("capabilities", capabilities); 450 data->SetString("capabilities", capabilities);
442 PostChromotingMessage("setCapabilities", data.Pass()); 451 PostChromotingMessage("setCapabilities", data.Pass());
443 } 452 }
444 453
445 void ChromotingInstance::SetPairingResponse( 454 void ChromotingInstance::SetPairingResponse(
446 const protocol::PairingResponse& pairing_response) { 455 const protocol::PairingResponse& pairing_response) {
447 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 456 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
448 data->SetString("clientId", pairing_response.client_id()); 457 data->SetString("clientId", pairing_response.client_id());
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 url_components.scheme.len); 1075 url_components.scheme.len);
1067 return url_scheme == kChromeExtensionUrlScheme; 1076 return url_scheme == kChromeExtensionUrlScheme;
1068 } 1077 }
1069 1078
1070 bool ChromotingInstance::IsConnected() { 1079 bool ChromotingInstance::IsConnected() {
1071 return host_connection_.get() && 1080 return host_connection_.get() &&
1072 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 1081 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
1073 } 1082 }
1074 1083
1075 } // namespace remoting 1084 } // 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