| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/crw_mock_web_state_delegate.h" | 5 #import "ios/web/public/test/crw_mock_web_state_delegate.h" |
| 6 | 6 |
| 7 #import "ios/web/public/web_state/context_menu_params.h" | 7 #import "ios/web/public/web_state/context_menu_params.h" |
| 8 #import "ios/web/public/web_state/web_state.h" | 8 #import "ios/web/public/web_state/web_state.h" |
| 9 | 9 |
| 10 @implementation CRWMockWebStateDelegate { | 10 @implementation CRWMockWebStateDelegate { |
| 11 // Backs up the property with the same name. | 11 // Backs up the property with the same name. |
| 12 std::unique_ptr<web::WebState::OpenURLParams> _openURLParams; | 12 std::unique_ptr<web::WebState::OpenURLParams> _openURLParams; |
| 13 // Backs up the property with the same name. | 13 // Backs up the property with the same name. |
| 14 std::unique_ptr<web::ContextMenuParams> _contextMenuParams; | 14 std::unique_ptr<web::ContextMenuParams> _contextMenuParams; |
| 15 // Backs up the property with the same name. | 15 // Backs up the property with the same name. |
| 16 BOOL _javaScriptDialogPresenterRequested; | 16 BOOL _javaScriptDialogPresenterRequested; |
| 17 } | 17 } |
| 18 | 18 |
| 19 @synthesize webState = _webState; | 19 @synthesize webState = _webState; |
| 20 @synthesize webStateCreationRequested = _webStateCreationRequested; | 20 @synthesize webStateCreationRequested = _webStateCreationRequested; |
| 21 @synthesize webStateClosingRequested = _webStateClosingRequested; |
| 21 @synthesize repostFormWarningRequested = _repostFormWarningRequested; | 22 @synthesize repostFormWarningRequested = _repostFormWarningRequested; |
| 22 @synthesize authenticationRequested = _authenticationRequested; | 23 @synthesize authenticationRequested = _authenticationRequested; |
| 23 | 24 |
| 24 - (web::WebState*)webState:(web::WebState*)webState | 25 - (web::WebState*)webState:(web::WebState*)webState |
| 25 createNewWebStateForURL:(const GURL&)URL | 26 createNewWebStateForURL:(const GURL&)URL |
| 26 openerURL:(const GURL&)openerURL | 27 openerURL:(const GURL&)openerURL |
| 27 initiatedByUser:(BOOL)initiatedByUser { | 28 initiatedByUser:(BOOL)initiatedByUser { |
| 28 _webState = webState; | 29 _webState = webState; |
| 29 _webStateCreationRequested = YES; | 30 _webStateCreationRequested = YES; |
| 30 return nil; | 31 return nil; |
| 31 } | 32 } |
| 32 | 33 |
| 34 - (void)closeWebState:(web::WebState*)webState { |
| 35 _webState = webState; |
| 36 _webStateClosingRequested = YES; |
| 37 } |
| 38 |
| 33 - (web::WebState*)webState:(web::WebState*)webState | 39 - (web::WebState*)webState:(web::WebState*)webState |
| 34 openURLWithParams:(const web::WebState::OpenURLParams&)params { | 40 openURLWithParams:(const web::WebState::OpenURLParams&)params { |
| 35 _webState = webState; | 41 _webState = webState; |
| 36 _openURLParams.reset(new web::WebState::OpenURLParams(params)); | 42 _openURLParams.reset(new web::WebState::OpenURLParams(params)); |
| 37 return webState; | 43 return webState; |
| 38 } | 44 } |
| 39 | 45 |
| 40 - (BOOL)webState:(web::WebState*)webState | 46 - (BOOL)webState:(web::WebState*)webState |
| 41 handleContextMenu:(const web::ContextMenuParams&)params { | 47 handleContextMenu:(const web::ContextMenuParams&)params { |
| 42 _webState = webState; | 48 _webState = webState; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 72 | 78 |
| 73 - (web::ContextMenuParams*)contextMenuParams { | 79 - (web::ContextMenuParams*)contextMenuParams { |
| 74 return _contextMenuParams.get(); | 80 return _contextMenuParams.get(); |
| 75 } | 81 } |
| 76 | 82 |
| 77 - (BOOL)javaScriptDialogPresenterRequested { | 83 - (BOOL)javaScriptDialogPresenterRequested { |
| 78 return _javaScriptDialogPresenterRequested; | 84 return _javaScriptDialogPresenterRequested; |
| 79 } | 85 } |
| 80 | 86 |
| 81 @end | 87 @end |
| OLD | NEW |