| 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/crw_test_web_state_observer.h" | 5 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace web { | 9 namespace web { |
| 10 TestFormActivityInfo::TestFormActivityInfo() {} | 10 TestFormActivityInfo::TestFormActivityInfo() {} |
| 11 TestFormActivityInfo::~TestFormActivityInfo() = default; | 11 TestFormActivityInfo::~TestFormActivityInfo() = default; |
| 12 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {} | 12 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {} |
| 13 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() = | 13 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() = |
| 14 default; | 14 default; |
| 15 } | 15 } |
| 16 | 16 |
| 17 @implementation CRWTestWebStateObserver { | 17 @implementation CRWTestWebStateObserver { |
| 18 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|. | 18 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|. |
| 19 std::unique_ptr<web::TestStartProvisionalNavigationInfo> | 19 std::unique_ptr<web::TestStartProvisionalNavigationInfo> |
| 20 _startProvisionalNavigationInfo; | 20 _startProvisionalNavigationInfo; |
| 21 // Arguments passed to |webState:didCommitNavigationWithDetails:|. | 21 // Arguments passed to |webState:didCommitNavigationWithDetails:|. |
| 22 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; | 22 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; |
| 23 // Arguments passed to |webState:didLoadPageWithSuccess:|. | 23 // Arguments passed to |webState:didLoadPageWithSuccess:|. |
| 24 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; | 24 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; |
| 25 // Arguments passed to |webStateDidDismissInterstitial:|. | 25 // Arguments passed to |webStateDidDismissInterstitial:|. |
| 26 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; | 26 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; |
| 27 // Arguments passed to |webStateDidChangeURLHash:|. | |
| 28 std::unique_ptr<web::TestChangeUrlHashInfo> _changeUrlHashInfo; | |
| 29 // Arguments passed to |webStateDidChangeHistoryState:|. | 27 // Arguments passed to |webStateDidChangeHistoryState:|. |
| 30 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; | 28 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; |
| 31 // Arguments passed to |webState:didChangeLoadingProgress:|. | 29 // Arguments passed to |webState:didChangeLoadingProgress:|. |
| 32 std::unique_ptr<web::TestChangeLoadingProgressInfo> | 30 std::unique_ptr<web::TestChangeLoadingProgressInfo> |
| 33 _changeLoadingProgressInfo; | 31 _changeLoadingProgressInfo; |
| 34 // Arguments passed to | 32 // Arguments passed to |
| 35 // |webState:didSubmitDocumentWithFormNamed:userInitiated:|. | 33 // |webState:didSubmitDocumentWithFormNamed:userInitiated:|. |
| 36 std::unique_ptr<web::TestSubmitDocumentInfo> _submitDocumentInfo; | 34 std::unique_ptr<web::TestSubmitDocumentInfo> _submitDocumentInfo; |
| 37 // Arguments passed to | 35 // Arguments passed to |
| 38 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|. | 36 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 59 } | 57 } |
| 60 | 58 |
| 61 - (web::TestLoadPageInfo*)loadPageInfo { | 59 - (web::TestLoadPageInfo*)loadPageInfo { |
| 62 return _loadPageInfo.get(); | 60 return _loadPageInfo.get(); |
| 63 } | 61 } |
| 64 | 62 |
| 65 - (web::TestDismissInterstitialInfo*)dismissInterstitialInfo { | 63 - (web::TestDismissInterstitialInfo*)dismissInterstitialInfo { |
| 66 return _dismissInterstitialInfo.get(); | 64 return _dismissInterstitialInfo.get(); |
| 67 } | 65 } |
| 68 | 66 |
| 69 - (web::TestChangeUrlHashInfo*)changeUrlHashInfo { | |
| 70 return _changeUrlHashInfo.get(); | |
| 71 } | |
| 72 | |
| 73 - (web::TestChangeHistoryStateInfo*)changeHistoryStateInfo { | 67 - (web::TestChangeHistoryStateInfo*)changeHistoryStateInfo { |
| 74 return _changeHistoryStateInfo.get(); | 68 return _changeHistoryStateInfo.get(); |
| 75 } | 69 } |
| 76 | 70 |
| 77 - (web::TestChangeLoadingProgressInfo*)changeLoadingProgressInfo { | 71 - (web::TestChangeLoadingProgressInfo*)changeLoadingProgressInfo { |
| 78 return _changeLoadingProgressInfo.get(); | 72 return _changeLoadingProgressInfo.get(); |
| 79 } | 73 } |
| 80 | 74 |
| 81 - (web::TestSubmitDocumentInfo*)submitDocumentInfo { | 75 - (web::TestSubmitDocumentInfo*)submitDocumentInfo { |
| 82 return _submitDocumentInfo.get(); | 76 return _submitDocumentInfo.get(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 _loadPageInfo->web_state = webState; | 123 _loadPageInfo->web_state = webState; |
| 130 _loadPageInfo->success = success; | 124 _loadPageInfo->success = success; |
| 131 } | 125 } |
| 132 | 126 |
| 133 - (void)webStateDidDismissInterstitial:(web::WebState*)webState { | 127 - (void)webStateDidDismissInterstitial:(web::WebState*)webState { |
| 134 _dismissInterstitialInfo = | 128 _dismissInterstitialInfo = |
| 135 base::MakeUnique<web::TestDismissInterstitialInfo>(); | 129 base::MakeUnique<web::TestDismissInterstitialInfo>(); |
| 136 _dismissInterstitialInfo->web_state = webState; | 130 _dismissInterstitialInfo->web_state = webState; |
| 137 } | 131 } |
| 138 | 132 |
| 139 - (void)webStateDidChangeURLHash:(web::WebState*)webState { | |
| 140 _changeUrlHashInfo = base::MakeUnique<web::TestChangeUrlHashInfo>(); | |
| 141 _changeUrlHashInfo->web_state = webState; | |
| 142 } | |
| 143 | |
| 144 - (void)webStateDidChangeHistoryState:(web::WebState*)webState { | 133 - (void)webStateDidChangeHistoryState:(web::WebState*)webState { |
| 145 _changeHistoryStateInfo = base::MakeUnique<web::TestChangeHistoryStateInfo>(); | 134 _changeHistoryStateInfo = base::MakeUnique<web::TestChangeHistoryStateInfo>(); |
| 146 _changeHistoryStateInfo->web_state = webState; | 135 _changeHistoryStateInfo->web_state = webState; |
| 147 } | 136 } |
| 148 | 137 |
| 149 - (void)webState:(web::WebState*)webState | 138 - (void)webState:(web::WebState*)webState |
| 150 didChangeLoadingProgress:(double)progress { | 139 didChangeLoadingProgress:(double)progress { |
| 151 _changeLoadingProgressInfo = | 140 _changeLoadingProgressInfo = |
| 152 base::MakeUnique<web::TestChangeLoadingProgressInfo>(); | 141 base::MakeUnique<web::TestChangeLoadingProgressInfo>(); |
| 153 _changeLoadingProgressInfo->web_state = webState; | 142 _changeLoadingProgressInfo->web_state = webState; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); | 190 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 202 _stopLoadingInfo->web_state = webState; | 191 _stopLoadingInfo->web_state = webState; |
| 203 } | 192 } |
| 204 | 193 |
| 205 - (void)webStateDidStartLoading:(web::WebState*)webState { | 194 - (void)webStateDidStartLoading:(web::WebState*)webState { |
| 206 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); | 195 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 207 _startLoadingInfo->web_state = webState; | 196 _startLoadingInfo->web_state = webState; |
| 208 } | 197 } |
| 209 | 198 |
| 210 @end | 199 @end |
| OLD | NEW |