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

Unified Diff: remoting/protocol/host_control_dispatcher.cc

Issue 14715012: Protocol-level changes required to support PIN-less authentication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/host_control_dispatcher.cc
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc
index a213ac6eeb3090c2cb5c29982420b425bb41fd6d..c435b4ffb4ebac4cd65bc99da2ba6d77a763c9bf 100644
--- a/remoting/protocol/host_control_dispatcher.cc
+++ b/remoting/protocol/host_control_dispatcher.cc
@@ -19,7 +19,8 @@ namespace protocol {
HostControlDispatcher::HostControlDispatcher()
: ChannelDispatcherBase(kControlChannelName),
clipboard_stub_(NULL),
- host_stub_(NULL) {
+ host_stub_(NULL),
+ weak_factory_(this) {
}
HostControlDispatcher::~HostControlDispatcher() {
@@ -69,10 +70,21 @@ void HostControlDispatcher::OnMessageReceived(
host_stub_->ControlAudio(message->audio_control());
} else if (message->has_capabilities()) {
host_stub_->SetCapabilities(message->capabilities());
+ } else if (message->has_pairing_request()) {
+ host_stub_->RequestPairing(
+ message->pairing_request(),
+ base::Bind(&HostControlDispatcher::OnPairingReply,
rmsousa 2013/05/09 03:55:02 If you don't use a bound callback you can remove t
Jamie 2013/05/09 17:59:52 Done.
+ weak_factory_.GetWeakPtr()));
} else {
LOG(WARNING) << "Unknown control message received.";
}
}
+void HostControlDispatcher::OnPairingReply(const PairingReply& pairing_reply) {
rmsousa 2013/05/09 03:55:02 nit: Make this a verb (RespondToPairing?), move it
Jamie 2013/05/09 17:59:52 Done.
+ ControlMessage message;
+ message.mutable_pairing_reply()->CopyFrom(pairing_reply);
+ writer_.Write(SerializeAndFrameMessage(message), base::Closure());
+}
+
} // namespace protocol
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698