| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 return scoped_ptr<PrivetJSONOperation>( | 705 return scoped_ptr<PrivetJSONOperation>( |
| 706 new PrivetInfoOperationImpl(this, callback)); | 706 new PrivetInfoOperationImpl(this, callback)); |
| 707 } | 707 } |
| 708 | 708 |
| 709 scoped_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher( | 709 scoped_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher( |
| 710 const GURL& url, | 710 const GURL& url, |
| 711 net::URLFetcher::RequestType request_type, | 711 net::URLFetcher::RequestType request_type, |
| 712 PrivetURLFetcher::Delegate* delegate) { | 712 PrivetURLFetcher::Delegate* delegate) { |
| 713 GURL::Replacements replacements; | 713 GURL::Replacements replacements; |
| 714 replacements.SetHostStr(host_port_.host()); | 714 replacements.SetHostStr(host_port_.host()); |
| 715 std::string port(base::IntToString(host_port_.port())); // Keep string alive. | 715 std::string port( |
| 716 base::UintToString(host_port_.port())); // Keep string alive. |
| 716 replacements.SetPortStr(port); | 717 replacements.SetPortStr(port); |
| 717 return scoped_ptr<PrivetURLFetcher>( | 718 return scoped_ptr<PrivetURLFetcher>( |
| 718 new PrivetURLFetcher(url.ReplaceComponents(replacements), | 719 new PrivetURLFetcher(url.ReplaceComponents(replacements), |
| 719 request_type, | 720 request_type, |
| 720 request_context_.get(), | 721 request_context_.get(), |
| 721 delegate)); | 722 delegate)); |
| 722 } | 723 } |
| 723 | 724 |
| 724 void PrivetHTTPClientImpl::RefreshPrivetToken( | 725 void PrivetHTTPClientImpl::RefreshPrivetToken( |
| 725 const PrivetURLFetcher::TokenCallback& callback) { | 726 const PrivetURLFetcher::TokenCallback& callback) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 PrivetLocalPrintOperation::Delegate* delegate) { | 791 PrivetLocalPrintOperation::Delegate* delegate) { |
| 791 #if defined(ENABLE_PRINT_PREVIEW) | 792 #if defined(ENABLE_PRINT_PREVIEW) |
| 792 return scoped_ptr<PrivetLocalPrintOperation>( | 793 return scoped_ptr<PrivetLocalPrintOperation>( |
| 793 new PrivetLocalPrintOperationImpl(info_client(), delegate)); | 794 new PrivetLocalPrintOperationImpl(info_client(), delegate)); |
| 794 #else | 795 #else |
| 795 return scoped_ptr<PrivetLocalPrintOperation>(); | 796 return scoped_ptr<PrivetLocalPrintOperation>(); |
| 796 #endif // ENABLE_PRINT_PREVIEW | 797 #endif // ENABLE_PRINT_PREVIEW |
| 797 } | 798 } |
| 798 | 799 |
| 799 } // namespace local_discovery | 800 } // namespace local_discovery |
| OLD | NEW |