OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/local_discovery/privetv3_session.h" | 5 #include "chrome/browser/local_discovery/privetv3_session.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/local_discovery/privet_http.h" | 10 #include "chrome/browser/local_discovery/privet_http.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 scoped_ptr<PrivetURLFetcher> url_fetcher = | 126 scoped_ptr<PrivetURLFetcher> url_fetcher = |
127 client_->CreateURLFetcher(CreatePrivetURL(request->GetName()), | 127 client_->CreateURLFetcher(CreatePrivetURL(request->GetName()), |
128 net::URLFetcher::POST, | 128 net::URLFetcher::POST, |
129 request->fetcher_delegate_.get()); | 129 request->fetcher_delegate_.get()); |
130 std::string json; | 130 std::string json; |
131 base::JSONWriter::WriteWithOptions( | 131 base::JSONWriter::WriteWithOptions( |
132 &request->GetInput(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); | 132 &request->GetInput(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); |
133 url_fetcher->SetUploadData(cloud_print::kContentTypeJSON, json); | 133 url_fetcher->SetUploadData(cloud_print::kContentTypeJSON, json); |
134 | 134 |
135 request->fetcher_delegate_->url_fetcher_ = url_fetcher.Pass(); | 135 request->fetcher_delegate_->url_fetcher_ = url_fetcher.Pass(); |
| 136 request->fetcher_delegate_->url_fetcher_->V3Mode(); |
136 request->fetcher_delegate_->url_fetcher_->Start(); | 137 request->fetcher_delegate_->url_fetcher_->Start(); |
137 } | 138 } |
138 | 139 |
139 void PrivetV3Session::ConfirmFakeCode() { | 140 void PrivetV3Session::ConfirmFakeCode() { |
140 delegate_->OnSetupConfirmationNeeded( | 141 delegate_->OnSetupConfirmationNeeded( |
141 kStubPrivetCode, | 142 kStubPrivetCode, |
142 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); | 143 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); |
143 } | 144 } |
144 | 145 |
145 } // namespace local_discovery | 146 } // namespace local_discovery |
OLD | NEW |