| 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 "chrome/browser/local_discovery/privet_http_impl.h" | 5 #include "chrome/browser/local_discovery/privet_http_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 const PrivetJSONOperation::ResultCallback& callback) { | 709 const PrivetJSONOperation::ResultCallback& callback) { |
| 710 return scoped_ptr<PrivetJSONOperation>( | 710 return scoped_ptr<PrivetJSONOperation>( |
| 711 new PrivetInfoOperationImpl(this, callback)); | 711 new PrivetInfoOperationImpl(this, callback)); |
| 712 } | 712 } |
| 713 | 713 |
| 714 scoped_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher( | 714 scoped_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher( |
| 715 const GURL& url, | 715 const GURL& url, |
| 716 net::URLFetcher::RequestType request_type, | 716 net::URLFetcher::RequestType request_type, |
| 717 PrivetURLFetcher::Delegate* delegate) { | 717 PrivetURLFetcher::Delegate* delegate) { |
| 718 GURL::Replacements replacements; | 718 GURL::Replacements replacements; |
| 719 replacements.SetHostStr(host_port_.host()); | 719 std::string host = host_port_.HostForURL(); |
| 720 replacements.SetHostStr(host); |
| 720 std::string port = base::UintToString(host_port_.port()); | 721 std::string port = base::UintToString(host_port_.port()); |
| 721 replacements.SetPortStr(port); | 722 replacements.SetPortStr(port); |
| 722 std::string scheme = IsInHttpsMode() ? "https" : "http"; | 723 std::string scheme = IsInHttpsMode() ? "https" : "http"; |
| 723 replacements.SetSchemeStr(scheme); | 724 replacements.SetSchemeStr(scheme); |
| 724 return scoped_ptr<PrivetURLFetcher>( | 725 return scoped_ptr<PrivetURLFetcher>( |
| 725 new PrivetURLFetcher(url.ReplaceComponents(replacements), request_type, | 726 new PrivetURLFetcher(url.ReplaceComponents(replacements), request_type, |
| 726 context_getter_, delegate)); | 727 context_getter_, delegate)); |
| 727 } | 728 } |
| 728 | 729 |
| 729 void PrivetHTTPClientImpl::RefreshPrivetToken( | 730 void PrivetHTTPClientImpl::RefreshPrivetToken( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 PrivetLocalPrintOperation::Delegate* delegate) { | 813 PrivetLocalPrintOperation::Delegate* delegate) { |
| 813 #if defined(ENABLE_PRINT_PREVIEW) | 814 #if defined(ENABLE_PRINT_PREVIEW) |
| 814 return scoped_ptr<PrivetLocalPrintOperation>( | 815 return scoped_ptr<PrivetLocalPrintOperation>( |
| 815 new PrivetLocalPrintOperationImpl(info_client(), delegate)); | 816 new PrivetLocalPrintOperationImpl(info_client(), delegate)); |
| 816 #else | 817 #else |
| 817 return scoped_ptr<PrivetLocalPrintOperation>(); | 818 return scoped_ptr<PrivetLocalPrintOperation>(); |
| 818 #endif // ENABLE_PRINT_PREVIEW | 819 #endif // ENABLE_PRINT_PREVIEW |
| 819 } | 820 } |
| 820 | 821 |
| 821 } // namespace local_discovery | 822 } // namespace local_discovery |
| OLD | NEW |