| 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::ContextMenuParams> _contextMenuParams; | 12 std::unique_ptr<web::ContextMenuParams> _contextMenuParams; |
| 13 // Backs up the property with the same name. |
| 14 BOOL _javaScriptDialogPresenterRequested; |
| 13 } | 15 } |
| 14 | 16 |
| 15 @synthesize webState = _webState; | 17 @synthesize webState = _webState; |
| 16 @synthesize changedProgress = _changedProgress; | 18 @synthesize changedProgress = _changedProgress; |
| 17 | 19 |
| 18 - (void)webState:(web::WebState*)webState didChangeProgress:(double)progress { | 20 - (void)webState:(web::WebState*)webState didChangeProgress:(double)progress { |
| 19 _webState = webState; | 21 _webState = webState; |
| 20 _changedProgress = progress; | 22 _changedProgress = progress; |
| 21 } | 23 } |
| 22 | 24 |
| 23 - (BOOL)webState:(web::WebState*)webState | 25 - (BOOL)webState:(web::WebState*)webState |
| 24 handleContextMenu:(const web::ContextMenuParams&)params { | 26 handleContextMenu:(const web::ContextMenuParams&)params { |
| 25 _webState = webState; | 27 _webState = webState; |
| 26 _contextMenuParams.reset(new web::ContextMenuParams(params)); | 28 _contextMenuParams.reset(new web::ContextMenuParams(params)); |
| 27 return YES; | 29 return YES; |
| 28 } | 30 } |
| 29 | 31 |
| 32 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: |
| 33 (web::WebState*)webState { |
| 34 _webState = webState; |
| 35 _javaScriptDialogPresenterRequested = YES; |
| 36 return nil; |
| 37 } |
| 38 |
| 30 - (web::ContextMenuParams*)contextMenuParams { | 39 - (web::ContextMenuParams*)contextMenuParams { |
| 31 return _contextMenuParams.get(); | 40 return _contextMenuParams.get(); |
| 32 } | 41 } |
| 33 | 42 |
| 43 - (BOOL)javaScriptDialogPresenterRequested { |
| 44 return _javaScriptDialogPresenterRequested; |
| 45 } |
| 46 |
| 34 @end | 47 @end |
| OLD | NEW |