Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1055)

Side by Side Diff: ios/web/web_state/web_state_delegate_bridge.mm

Issue 2642233004: Removed Form Resubmission callback from CRWWebDelegate. (Closed)
Patch Set: Added ShowRepostFormWarningWithNoDelegateMethod test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/web_state/web_state_delegate_bridge.h" 5 #import "ios/web/public/web_state/web_state_delegate_bridge.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.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 namespace web { 10 namespace web {
(...skipping 19 matching lines...) Expand all
30 30
31 bool WebStateDelegateBridge::HandleContextMenu( 31 bool WebStateDelegateBridge::HandleContextMenu(
32 WebState* source, 32 WebState* source,
33 const ContextMenuParams& params) { 33 const ContextMenuParams& params) {
34 if ([delegate_ respondsToSelector:@selector(webState:handleContextMenu:)]) { 34 if ([delegate_ respondsToSelector:@selector(webState:handleContextMenu:)]) {
35 return [delegate_ webState:source handleContextMenu:params]; 35 return [delegate_ webState:source handleContextMenu:params];
36 } 36 }
37 return NO; 37 return NO;
38 } 38 }
39 39
40 void WebStateDelegateBridge::ShowRepostFormWarningDialog(
41 WebState* source,
42 const base::Callback<void(bool)>& callback) {
43 base::Callback<void(bool)> local_callback(callback);
44 SEL selector = @selector(webState:runRepostFormDialogWithCompletionHandler:);
45 if ([delegate_ respondsToSelector:selector]) {
46 [delegate_ webState:source
47 runRepostFormDialogWithCompletionHandler:^(BOOL should_continue) {
48 local_callback.Run(should_continue);
49 }];
50 } else {
51 local_callback.Run(true);
52 }
53 }
54
40 JavaScriptDialogPresenter* WebStateDelegateBridge::GetJavaScriptDialogPresenter( 55 JavaScriptDialogPresenter* WebStateDelegateBridge::GetJavaScriptDialogPresenter(
41 WebState* source) { 56 WebState* source) {
42 SEL selector = @selector(javaScriptDialogPresenterForWebState:); 57 SEL selector = @selector(javaScriptDialogPresenterForWebState:);
43 if ([delegate_ respondsToSelector:selector]) { 58 if ([delegate_ respondsToSelector:selector]) {
44 return [delegate_ javaScriptDialogPresenterForWebState:source]; 59 return [delegate_ javaScriptDialogPresenterForWebState:source];
45 } 60 }
46 return nullptr; 61 return nullptr;
47 } 62 }
48 63
49 void WebStateDelegateBridge::OnAuthRequired( 64 void WebStateDelegateBridge::OnAuthRequired(
(...skipping 13 matching lines...) Expand all
63 completionHandler:^(NSString* username, 78 completionHandler:^(NSString* username,
64 NSString* password) { 79 NSString* password) {
65 local_callback.Run(username, password); 80 local_callback.Run(username, password);
66 }]; 81 }];
67 } else { 82 } else {
68 local_callback.Run(nil, nil); 83 local_callback.Run(nil, nil);
69 } 84 }
70 } 85 }
71 86
72 } // web 87 } // web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_delegate.mm ('k') | ios/web/web_state/web_state_delegate_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698