| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 token_callbacks_.push_back(callback); | 732 token_callbacks_.push_back(callback); |
| 733 | 733 |
| 734 if (!info_operation_) { | 734 if (!info_operation_) { |
| 735 info_operation_ = CreateInfoOperation( | 735 info_operation_ = CreateInfoOperation( |
| 736 base::Bind(&PrivetHTTPClientImpl::OnPrivetInfoDone, | 736 base::Bind(&PrivetHTTPClientImpl::OnPrivetInfoDone, |
| 737 base::Unretained(this))); | 737 base::Unretained(this))); |
| 738 info_operation_->Start(); | 738 info_operation_->Start(); |
| 739 } | 739 } |
| 740 } | 740 } |
| 741 | 741 |
| 742 void PrivetHTTPClientImpl::SwitchToHttps( | 742 void PrivetHTTPClientImpl::SwitchToHttps(uint16_t port) { |
| 743 uint16_t port, | |
| 744 const net::SHA256HashValue& certificate_fingerprint) { | |
| 745 use_https_ = true; | 743 use_https_ = true; |
| 746 host_port_.set_port(port); | 744 host_port_.set_port(port); |
| 747 context_getter_ = new extensions::PrivetV3ContextGetter( | |
| 748 context_getter_->GetNetworkTaskRunner(), certificate_fingerprint); | |
| 749 } | 745 } |
| 750 | 746 |
| 751 bool PrivetHTTPClientImpl::IsInHttpsMode() const { | 747 bool PrivetHTTPClientImpl::IsInHttpsMode() const { |
| 752 return use_https_; | 748 return use_https_; |
| 753 } | 749 } |
| 754 | 750 |
| 755 std::string PrivetHTTPClientImpl::GetHost() const { | 751 std::string PrivetHTTPClientImpl::GetHost() const { |
| 756 return host_port_.host(); | 752 return host_port_.host(); |
| 757 } | 753 } |
| 758 | 754 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 PrivetLocalPrintOperation::Delegate* delegate) { | 809 PrivetLocalPrintOperation::Delegate* delegate) { |
| 814 #if defined(ENABLE_PRINT_PREVIEW) | 810 #if defined(ENABLE_PRINT_PREVIEW) |
| 815 return scoped_ptr<PrivetLocalPrintOperation>( | 811 return scoped_ptr<PrivetLocalPrintOperation>( |
| 816 new PrivetLocalPrintOperationImpl(info_client(), delegate)); | 812 new PrivetLocalPrintOperationImpl(info_client(), delegate)); |
| 817 #else | 813 #else |
| 818 return scoped_ptr<PrivetLocalPrintOperation>(); | 814 return scoped_ptr<PrivetLocalPrintOperation>(); |
| 819 #endif // ENABLE_PRINT_PREVIEW | 815 #endif // ENABLE_PRINT_PREVIEW |
| 820 } | 816 } |
| 821 | 817 |
| 822 } // namespace local_discovery | 818 } // namespace local_discovery |
| OLD | NEW |