| 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" |
| 11 #include "chrome/common/cloud_print/cloud_print_constants.h" | 11 #include "chrome/common/cloud_print/cloud_print_constants.h" |
| 12 | 12 |
| 13 namespace local_discovery { | 13 namespace local_discovery { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const char kUrlPlaceHolder[] = "http://host/"; | 17 const char kUrlPlaceHolder[] = "http://host/"; |
| 18 | 18 |
| 19 const char kStubPrivetCode[] = "01234"; | 19 const char kStubPrivetCode[] = "1234"; |
| 20 | 20 |
| 21 GURL CreatePrivetURL(const std::string& path) { | 21 GURL CreatePrivetURL(const std::string& path) { |
| 22 GURL url(kUrlPlaceHolder); | 22 GURL url(kUrlPlaceHolder); |
| 23 GURL::Replacements replacements; | 23 GURL::Replacements replacements; |
| 24 replacements.SetPathStr(path); | 24 replacements.SetPathStr(path); |
| 25 return url.ReplaceComponents(replacements); | 25 return url.ReplaceComponents(replacements); |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 request->fetcher_delegate_->url_fetcher_->Start(); | 136 request->fetcher_delegate_->url_fetcher_->Start(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void PrivetV3Session::ConfirmFakeCode() { | 139 void PrivetV3Session::ConfirmFakeCode() { |
| 140 delegate_->OnSetupConfirmationNeeded( | 140 delegate_->OnSetupConfirmationNeeded( |
| 141 kStubPrivetCode, | 141 kStubPrivetCode, |
| 142 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); | 142 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace local_discovery | 145 } // namespace local_discovery |
| OLD | NEW |