| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_observer_bridge.h" | 5 #import "ios/web/public/web_state/web_state_observer_bridge.h" |
| 6 | 6 |
| 7 namespace web { | 7 namespace web { |
| 8 | 8 |
| 9 WebStateObserverBridge::WebStateObserverBridge(web::WebState* webState, | 9 WebStateObserverBridge::WebStateObserverBridge(web::WebState* webState, |
| 10 id<CRWWebStateObserver> observer) | 10 id<CRWWebStateObserver> observer) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 didSubmitDocumentWithFormNamed:form_name | 78 didSubmitDocumentWithFormNamed:form_name |
| 79 userInitiated:user_initiated]; | 79 userInitiated:user_initiated]; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void WebStateObserverBridge::FormActivityRegistered( | 83 void WebStateObserverBridge::FormActivityRegistered( |
| 84 const std::string& form_name, | 84 const std::string& form_name, |
| 85 const std::string& field_name, | 85 const std::string& field_name, |
| 86 const std::string& type, | 86 const std::string& type, |
| 87 const std::string& value, | 87 const std::string& value, |
| 88 int key_code, | |
| 89 bool input_missing) { | 88 bool input_missing) { |
| 90 SEL selector = @selector(webState: | 89 SEL selector = @selector(webState: |
| 91 didRegisterFormActivityWithFormNamed: | 90 didRegisterFormActivityWithFormNamed: |
| 92 fieldName: | 91 fieldName: |
| 93 type: | 92 type: |
| 94 value: | 93 value: |
| 95 keyCode: | |
| 96 inputMissing:); | 94 inputMissing:); |
| 97 if ([observer_ respondsToSelector:selector]) { | 95 if ([observer_ respondsToSelector:selector]) { |
| 98 [observer_ webState:web_state() | 96 [observer_ webState:web_state() |
| 99 didRegisterFormActivityWithFormNamed:form_name | 97 didRegisterFormActivityWithFormNamed:form_name |
| 100 fieldName:field_name | 98 fieldName:field_name |
| 101 type:type | 99 type:type |
| 102 value:value | 100 value:value |
| 103 keyCode:key_code | |
| 104 inputMissing:input_missing]; | 101 inputMissing:input_missing]; |
| 105 } | 102 } |
| 106 } | 103 } |
| 107 | 104 |
| 108 void WebStateObserverBridge::FaviconUrlUpdated( | 105 void WebStateObserverBridge::FaviconUrlUpdated( |
| 109 const std::vector<FaviconURL>& candidates) { | 106 const std::vector<FaviconURL>& candidates) { |
| 110 SEL selector = @selector(webState:didUpdateFaviconURLCandidates:); | 107 SEL selector = @selector(webState:didUpdateFaviconURLCandidates:); |
| 111 if ([observer_ respondsToSelector:selector]) | 108 if ([observer_ respondsToSelector:selector]) |
| 112 [observer_ webState:web_state() didUpdateFaviconURLCandidates:candidates]; | 109 [observer_ webState:web_state() didUpdateFaviconURLCandidates:candidates]; |
| 113 } | 110 } |
| 114 | 111 |
| 115 void WebStateObserverBridge::WebStateDestroyed() { | 112 void WebStateObserverBridge::WebStateDestroyed() { |
| 116 SEL selector = @selector(webStateDestroyed:); | 113 SEL selector = @selector(webStateDestroyed:); |
| 117 if ([observer_ respondsToSelector:selector]) { | 114 if ([observer_ respondsToSelector:selector]) { |
| 118 // |webStateDestroyed:| may delete |this|, so don't expect |this| to be | 115 // |webStateDestroyed:| may delete |this|, so don't expect |this| to be |
| 119 // valid afterwards. | 116 // valid afterwards. |
| 120 [observer_ webStateDestroyed:web_state()]; | 117 [observer_ webStateDestroyed:web_state()]; |
| 121 } | 118 } |
| 122 } | 119 } |
| 123 | 120 |
| 124 } // namespace web | 121 } // namespace web |
| OLD | NEW |