| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 [context[web::kUserIsInteractingKey] boolValue])); | 2896 [context[web::kUserIsInteractingKey] boolValue])); |
| 2897 return YES; | 2897 return YES; |
| 2898 } | 2898 } |
| 2899 | 2899 |
| 2900 - (BOOL)handleFormActivityMessage:(base::DictionaryValue*)message | 2900 - (BOOL)handleFormActivityMessage:(base::DictionaryValue*)message |
| 2901 context:(NSDictionary*)context { | 2901 context:(NSDictionary*)context { |
| 2902 std::string formName; | 2902 std::string formName; |
| 2903 std::string fieldName; | 2903 std::string fieldName; |
| 2904 std::string type; | 2904 std::string type; |
| 2905 std::string value; | 2905 std::string value; |
| 2906 int keyCode = web::WebStateObserver::kInvalidFormKeyCode; | |
| 2907 bool inputMissing = false; | 2906 bool inputMissing = false; |
| 2908 if (!message->GetString("formName", &formName) || | 2907 if (!message->GetString("formName", &formName) || |
| 2909 !message->GetString("fieldName", &fieldName) || | 2908 !message->GetString("fieldName", &fieldName) || |
| 2910 !message->GetString("type", &type) || | 2909 !message->GetString("type", &type) || |
| 2911 !message->GetString("value", &value)) { | 2910 !message->GetString("value", &value)) { |
| 2912 inputMissing = true; | 2911 inputMissing = true; |
| 2913 } | 2912 } |
| 2914 | 2913 |
| 2915 double keyCodeAsDouble = 0; | |
| 2916 if (!message->GetDouble("keyCode", &keyCodeAsDouble) || keyCodeAsDouble < 0) { | |
| 2917 keyCode = web::WebStateObserver::kInvalidFormKeyCode; | |
| 2918 } else { | |
| 2919 keyCode = static_cast<int>(keyCodeAsDouble); | |
| 2920 } | |
| 2921 _webStateImpl->OnFormActivityRegistered(formName, fieldName, type, value, | 2914 _webStateImpl->OnFormActivityRegistered(formName, fieldName, type, value, |
| 2922 keyCode, inputMissing); | 2915 inputMissing); |
| 2923 return YES; | 2916 return YES; |
| 2924 } | 2917 } |
| 2925 | 2918 |
| 2926 - (BOOL)handleCredentialsRequestedMessage:(base::DictionaryValue*)message | 2919 - (BOOL)handleCredentialsRequestedMessage:(base::DictionaryValue*)message |
| 2927 context:(NSDictionary*)context { | 2920 context:(NSDictionary*)context { |
| 2928 double request_id = -1; | 2921 double request_id = -1; |
| 2929 if (!message->GetDouble("requestId", &request_id)) { | 2922 if (!message->GetDouble("requestId", &request_id)) { |
| 2930 DLOG(WARNING) << "JS message parameter not found: requestId"; | 2923 DLOG(WARNING) << "JS message parameter not found: requestId"; |
| 2931 return NO; | 2924 return NO; |
| 2932 } | 2925 } |
| (...skipping 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5781 } | 5774 } |
| 5782 | 5775 |
| 5783 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5776 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5784 } | 5777 } |
| 5785 | 5778 |
| 5786 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5779 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5787 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5780 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5788 } | 5781 } |
| 5789 | 5782 |
| 5790 @end | 5783 @end |
| OLD | NEW |