OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/setup/service_client.h" | 5 #include "remoting/host/setup/service_client.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE); | 76 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE); |
77 pending_request_type_ = PENDING_REQUEST_REGISTER_HOST; | 77 pending_request_type_ = PENDING_REQUEST_REGISTER_HOST; |
78 base::DictionaryValue post_body; | 78 base::DictionaryValue post_body; |
79 post_body.SetString("data.hostId", host_id); | 79 post_body.SetString("data.hostId", host_id); |
80 post_body.SetString("data.hostName", host_name); | 80 post_body.SetString("data.hostName", host_name); |
81 post_body.SetString("data.publicKey", public_key); | 81 post_body.SetString("data.publicKey", public_key); |
82 std::string url_suffix; | 82 std::string url_suffix; |
83 if (!host_client_id.empty()) | 83 if (!host_client_id.empty()) |
84 url_suffix = "?hostClientId=" + host_client_id; | 84 url_suffix = "?hostClientId=" + host_client_id; |
85 std::string post_body_str; | 85 std::string post_body_str; |
86 base::JSONWriter::Write(&post_body, &post_body_str); | 86 base::JSONWriter::Write(post_body, &post_body_str); |
87 MakeChromotingRequest(net::URLFetcher::POST, | 87 MakeChromotingRequest(net::URLFetcher::POST, |
88 url_suffix, | 88 url_suffix, |
89 post_body_str, | 89 post_body_str, |
90 oauth_access_token, | 90 oauth_access_token, |
91 delegate); | 91 delegate); |
92 } | 92 } |
93 | 93 |
94 void ServiceClient::Core::UnregisterHost( | 94 void ServiceClient::Core::UnregisterHost( |
95 const std::string& host_id, | 95 const std::string& host_id, |
96 const std::string& oauth_access_token, | 96 const std::string& oauth_access_token, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 187 } |
188 | 188 |
189 void ServiceClient::UnregisterHost( | 189 void ServiceClient::UnregisterHost( |
190 const std::string& host_id, | 190 const std::string& host_id, |
191 const std::string& oauth_access_token, | 191 const std::string& oauth_access_token, |
192 Delegate* delegate) { | 192 Delegate* delegate) { |
193 return core_->UnregisterHost(host_id, oauth_access_token, delegate); | 193 return core_->UnregisterHost(host_id, oauth_access_token, delegate); |
194 } | 194 } |
195 | 195 |
196 } // namespace gaia | 196 } // namespace gaia |
OLD | NEW |