| 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/web_state/web_state_delegate_stub.h" | 5 #import "ios/web/web_state/web_state_delegate_stub.h" |
| 6 | 6 |
| 7 #import "ios/web/public/web_state/web_state.h" | 7 #import "ios/web/public/web_state/web_state.h" |
| 8 #import "ios/web/public/web_state/context_menu_params.h" | 8 #import "ios/web/public/web_state/context_menu_params.h" |
| 9 | 9 |
| 10 @implementation CRWWebStateDelegateStub { | 10 @implementation CRWWebStateDelegateStub { |
| 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; |
| 13 // Backs up the property with the same name. |
| 12 std::unique_ptr<web::ContextMenuParams> _contextMenuParams; | 14 std::unique_ptr<web::ContextMenuParams> _contextMenuParams; |
| 13 // Backs up the property with the same name. | 15 // Backs up the property with the same name. |
| 14 BOOL _javaScriptDialogPresenterRequested; | 16 BOOL _javaScriptDialogPresenterRequested; |
| 15 } | 17 } |
| 16 | 18 |
| 17 @synthesize webState = _webState; | 19 @synthesize webState = _webState; |
| 18 @synthesize changedProgress = _changedProgress; | 20 @synthesize changedProgress = _changedProgress; |
| 19 | 21 |
| 22 - (web::WebState*)webState:(web::WebState*)webState |
| 23 openURLWithParams:(const web::WebState::OpenURLParams&)params { |
| 24 _webState = webState; |
| 25 _openURLParams.reset(new web::WebState::OpenURLParams(params)); |
| 26 return webState; |
| 27 } |
| 28 |
| 20 - (void)webState:(web::WebState*)webState didChangeProgress:(double)progress { | 29 - (void)webState:(web::WebState*)webState didChangeProgress:(double)progress { |
| 21 _webState = webState; | 30 _webState = webState; |
| 22 _changedProgress = progress; | 31 _changedProgress = progress; |
| 23 } | 32 } |
| 24 | 33 |
| 25 - (BOOL)webState:(web::WebState*)webState | 34 - (BOOL)webState:(web::WebState*)webState |
| 26 handleContextMenu:(const web::ContextMenuParams&)params { | 35 handleContextMenu:(const web::ContextMenuParams&)params { |
| 27 _webState = webState; | 36 _webState = webState; |
| 28 _contextMenuParams.reset(new web::ContextMenuParams(params)); | 37 _contextMenuParams.reset(new web::ContextMenuParams(params)); |
| 29 return YES; | 38 return YES; |
| 30 } | 39 } |
| 31 | 40 |
| 32 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: | 41 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: |
| 33 (web::WebState*)webState { | 42 (web::WebState*)webState { |
| 34 _webState = webState; | 43 _webState = webState; |
| 35 _javaScriptDialogPresenterRequested = YES; | 44 _javaScriptDialogPresenterRequested = YES; |
| 36 return nil; | 45 return nil; |
| 37 } | 46 } |
| 38 | 47 |
| 48 - (const web::WebState::OpenURLParams*)openURLParams { |
| 49 return _openURLParams.get(); |
| 50 } |
| 51 |
| 39 - (web::ContextMenuParams*)contextMenuParams { | 52 - (web::ContextMenuParams*)contextMenuParams { |
| 40 return _contextMenuParams.get(); | 53 return _contextMenuParams.get(); |
| 41 } | 54 } |
| 42 | 55 |
| 43 - (BOOL)javaScriptDialogPresenterRequested { | 56 - (BOOL)javaScriptDialogPresenterRequested { |
| 44 return _javaScriptDialogPresenterRequested; | 57 return _javaScriptDialogPresenterRequested; |
| 45 } | 58 } |
| 46 | 59 |
| 47 @end | 60 @end |
| OLD | NEW |