| 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 repostFormWarningRequested = _repostFormWarningRequested; | 21 @synthesize repostFormWarningRequested = _repostFormWarningRequested; |
| 21 @synthesize authenticationRequested = _authenticationRequested; | 22 @synthesize authenticationRequested = _authenticationRequested; |
| 22 | 23 |
| 23 - (web::WebState*)webState:(web::WebState*)webState | 24 - (web::WebState*)webState:(web::WebState*)webState |
| 25 createNewWebStateForURL:(const GURL&)URL |
| 26 openerURL:(const GURL&)openerURL |
| 27 initiatedByUser:(BOOL)initiatedByUser { |
| 28 _webState = webState; |
| 29 _webStateCreationRequested = YES; |
| 30 return nil; |
| 31 } |
| 32 |
| 33 - (web::WebState*)webState:(web::WebState*)webState |
| 24 openURLWithParams:(const web::WebState::OpenURLParams&)params { | 34 openURLWithParams:(const web::WebState::OpenURLParams&)params { |
| 25 _webState = webState; | 35 _webState = webState; |
| 26 _openURLParams.reset(new web::WebState::OpenURLParams(params)); | 36 _openURLParams.reset(new web::WebState::OpenURLParams(params)); |
| 27 return webState; | 37 return webState; |
| 28 } | 38 } |
| 29 | 39 |
| 30 - (BOOL)webState:(web::WebState*)webState | 40 - (BOOL)webState:(web::WebState*)webState |
| 31 handleContextMenu:(const web::ContextMenuParams&)params { | 41 handleContextMenu:(const web::ContextMenuParams&)params { |
| 32 _webState = webState; | 42 _webState = webState; |
| 33 _contextMenuParams.reset(new web::ContextMenuParams(params)); | 43 _contextMenuParams.reset(new web::ContextMenuParams(params)); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 62 | 72 |
| 63 - (web::ContextMenuParams*)contextMenuParams { | 73 - (web::ContextMenuParams*)contextMenuParams { |
| 64 return _contextMenuParams.get(); | 74 return _contextMenuParams.get(); |
| 65 } | 75 } |
| 66 | 76 |
| 67 - (BOOL)javaScriptDialogPresenterRequested { | 77 - (BOOL)javaScriptDialogPresenterRequested { |
| 68 return _javaScriptDialogPresenterRequested; | 78 return _javaScriptDialogPresenterRequested; |
| 69 } | 79 } |
| 70 | 80 |
| 71 @end | 81 @end |
| OLD | NEW |