| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/web/public/test/fakes/test_web_state_delegate.h" | 5 #import "ios/web/public/test/fakes/test_web_state_delegate.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
| 9 namespace web { | 13 namespace web { |
| 10 | 14 |
| 11 TestOpenURLRequest::TestOpenURLRequest() | 15 TestOpenURLRequest::TestOpenURLRequest() |
| 12 : params(GURL(), | 16 : params(GURL(), |
| 13 Referrer(), | 17 Referrer(), |
| 14 WindowOpenDisposition::UNKNOWN, | 18 WindowOpenDisposition::UNKNOWN, |
| 15 ui::PAGE_TRANSITION_LINK, | 19 ui::PAGE_TRANSITION_LINK, |
| 16 false) {} | 20 false) {} |
| 17 | 21 |
| 18 TestOpenURLRequest::~TestOpenURLRequest() = default; | 22 TestOpenURLRequest::~TestOpenURLRequest() = default; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return &java_script_dialog_presenter_; | 115 return &java_script_dialog_presenter_; |
| 112 } | 116 } |
| 113 | 117 |
| 114 void TestWebStateDelegate::OnAuthRequired( | 118 void TestWebStateDelegate::OnAuthRequired( |
| 115 WebState* source, | 119 WebState* source, |
| 116 NSURLProtectionSpace* protection_space, | 120 NSURLProtectionSpace* protection_space, |
| 117 NSURLCredential* credential, | 121 NSURLCredential* credential, |
| 118 const AuthCallback& callback) { | 122 const AuthCallback& callback) { |
| 119 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>(); | 123 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>(); |
| 120 last_authentication_request_->web_state = source; | 124 last_authentication_request_->web_state = source; |
| 121 last_authentication_request_->protection_space.reset( | 125 last_authentication_request_->protection_space = protection_space; |
| 122 [protection_space retain]); | 126 last_authentication_request_->credential = credential; |
| 123 last_authentication_request_->credential.reset([credential retain]); | |
| 124 last_authentication_request_->auth_callback = callback; | 127 last_authentication_request_->auth_callback = callback; |
| 125 } | 128 } |
| 126 | 129 |
| 127 } // namespace web | 130 } // namespace web |
| OLD | NEW |