| 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/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 11 matching lines...) Expand all Loading... |
| 22 @selector(webState:createNewWebStateForURL:openerURL:initiatedByUser:); | 22 @selector(webState:createNewWebStateForURL:openerURL:initiatedByUser:); |
| 23 if ([delegate_ respondsToSelector:selector]) { | 23 if ([delegate_ respondsToSelector:selector]) { |
| 24 return [delegate_ webState:source | 24 return [delegate_ webState:source |
| 25 createNewWebStateForURL:url | 25 createNewWebStateForURL:url |
| 26 openerURL:opener_url | 26 openerURL:opener_url |
| 27 initiatedByUser:initiated_by_user]; | 27 initiatedByUser:initiated_by_user]; |
| 28 } | 28 } |
| 29 return nullptr; | 29 return nullptr; |
| 30 } | 30 } |
| 31 | 31 |
| 32 void WebStateDelegateBridge::CloseWebState(WebState* source) { |
| 33 if ([delegate_ respondsToSelector:@selector(closeWebState:)]) { |
| 34 [delegate_ closeWebState:source]; |
| 35 } |
| 36 } |
| 37 |
| 32 WebState* WebStateDelegateBridge::OpenURLFromWebState( | 38 WebState* WebStateDelegateBridge::OpenURLFromWebState( |
| 33 WebState* source, | 39 WebState* source, |
| 34 const WebState::OpenURLParams& params) { | 40 const WebState::OpenURLParams& params) { |
| 35 if ([delegate_ respondsToSelector:@selector(webState:openURLWithParams:)]) | 41 if ([delegate_ respondsToSelector:@selector(webState:openURLWithParams:)]) |
| 36 return [delegate_ webState:source openURLWithParams:params]; | 42 return [delegate_ webState:source openURLWithParams:params]; |
| 37 return nullptr; | 43 return nullptr; |
| 38 } | 44 } |
| 39 | 45 |
| 40 bool WebStateDelegateBridge::HandleContextMenu( | 46 bool WebStateDelegateBridge::HandleContextMenu( |
| 41 WebState* source, | 47 WebState* source, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 completionHandler:^(NSString* username, | 93 completionHandler:^(NSString* username, |
| 88 NSString* password) { | 94 NSString* password) { |
| 89 local_callback.Run(username, password); | 95 local_callback.Run(username, password); |
| 90 }]; | 96 }]; |
| 91 } else { | 97 } else { |
| 92 local_callback.Run(nil, nil); | 98 local_callback.Run(nil, nil); |
| 93 } | 99 } |
| 94 } | 100 } |
| 95 | 101 |
| 96 } // web | 102 } // web |
| OLD | NEW |