| 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/host/register_support_host_request.h" | 5 #include "remoting/host/register_support_host_request.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 callback_.Run(false, std::string()); | 74 callback_.Run(false, std::string()); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 DCHECK_EQ(message_loop_, MessageLoop::current()); | 77 DCHECK_EQ(message_loop_, MessageLoop::current()); |
| 78 request_.reset(); | 78 request_.reset(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Ignore any notifications other than signalling | 81 // Ignore any notifications other than signalling |
| 82 // connected/disconnected events. | 82 // connected/disconnected events. |
| 83 void RegisterSupportHostRequest::OnAccessDenied() { } | 83 void RegisterSupportHostRequest::OnAccessDenied() { } |
| 84 void RegisterSupportHostRequest::OnAuthenticatedClientsChanged(int clients) { } |
| 84 void RegisterSupportHostRequest::OnShutdown() { } | 85 void RegisterSupportHostRequest::OnShutdown() { } |
| 85 | 86 |
| 86 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( | 87 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( |
| 87 const std::string& jid) { | 88 const std::string& jid) { |
| 88 XmlElement* query = new XmlElement( | 89 XmlElement* query = new XmlElement( |
| 89 QName(kChromotingXmlNamespace, kRegisterQueryTag)); | 90 QName(kChromotingXmlNamespace, kRegisterQueryTag)); |
| 90 XmlElement* public_key = new XmlElement( | 91 XmlElement* public_key = new XmlElement( |
| 91 QName(kChromotingXmlNamespace, kPublicKeyTag)); | 92 QName(kChromotingXmlNamespace, kPublicKeyTag)); |
| 92 public_key->AddText(key_pair_.GetPublicKey()); | 93 public_key->AddText(key_pair_.GetPublicKey()); |
| 93 query->AddElement(public_key); | 94 query->AddElement(public_key); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 147 |
| 147 | 148 |
| 148 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { | 149 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { |
| 149 DCHECK_EQ(message_loop_, MessageLoop::current()); | 150 DCHECK_EQ(message_loop_, MessageLoop::current()); |
| 150 std::string support_id; | 151 std::string support_id; |
| 151 bool result = ParseResponse(response, &support_id); | 152 bool result = ParseResponse(response, &support_id); |
| 152 callback_.Run(result, support_id); | 153 callback_.Run(result, support_id); |
| 153 } | 154 } |
| 154 | 155 |
| 155 } // namespace remoting | 156 } // namespace remoting |
| OLD | NEW |