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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 use_https_ = true; | 744 use_https_ = true; |
745 host_port_.set_port(port); | 745 host_port_.set_port(port); |
746 context_getter_ = new extensions::PrivetV3ContextGetter( | 746 context_getter_ = new extensions::PrivetV3ContextGetter( |
747 context_getter_->GetNetworkTaskRunner(), certificate_fingerprint); | 747 context_getter_->GetNetworkTaskRunner(), certificate_fingerprint); |
748 } | 748 } |
749 | 749 |
750 bool PrivetHTTPClientImpl::IsInHttpsMode() const { | 750 bool PrivetHTTPClientImpl::IsInHttpsMode() const { |
751 return use_https_; | 751 return use_https_; |
752 } | 752 } |
753 | 753 |
| 754 std::string PrivetHTTPClientImpl::GetHost() const { |
| 755 return host_port_.host(); |
| 756 } |
| 757 |
754 void PrivetHTTPClientImpl::OnPrivetInfoDone( | 758 void PrivetHTTPClientImpl::OnPrivetInfoDone( |
755 const base::DictionaryValue* value) { | 759 const base::DictionaryValue* value) { |
756 info_operation_.reset(); | 760 info_operation_.reset(); |
757 std::string token; | 761 std::string token; |
758 | 762 |
759 // If this does not succeed, token will be empty, and an empty string | 763 // If this does not succeed, token will be empty, and an empty string |
760 // is our sentinel value, since empty X-Privet-Tokens are not allowed. | 764 // is our sentinel value, since empty X-Privet-Tokens are not allowed. |
761 if (value) { | 765 if (value) { |
762 value->GetString(kPrivetInfoKeyToken, &token); | 766 value->GetString(kPrivetInfoKeyToken, &token); |
763 } | 767 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 PrivetLocalPrintOperation::Delegate* delegate) { | 812 PrivetLocalPrintOperation::Delegate* delegate) { |
809 #if defined(ENABLE_PRINT_PREVIEW) | 813 #if defined(ENABLE_PRINT_PREVIEW) |
810 return scoped_ptr<PrivetLocalPrintOperation>( | 814 return scoped_ptr<PrivetLocalPrintOperation>( |
811 new PrivetLocalPrintOperationImpl(info_client(), delegate)); | 815 new PrivetLocalPrintOperationImpl(info_client(), delegate)); |
812 #else | 816 #else |
813 return scoped_ptr<PrivetLocalPrintOperation>(); | 817 return scoped_ptr<PrivetLocalPrintOperation>(); |
814 #endif // ENABLE_PRINT_PREVIEW | 818 #endif // ENABLE_PRINT_PREVIEW |
815 } | 819 } |
816 | 820 |
817 } // namespace local_discovery | 821 } // namespace local_discovery |
OLD | NEW |