| 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 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 if (!message->GetBoolean("unmediated", &unmediated)) { | 2837 if (!message->GetBoolean("unmediated", &unmediated)) { |
| 2838 DLOG(WARNING) << "JS message parameter not found: unmediated"; | 2838 DLOG(WARNING) << "JS message parameter not found: unmediated"; |
| 2839 return NO; | 2839 return NO; |
| 2840 } | 2840 } |
| 2841 base::ListValue* federations_value = nullptr; | 2841 base::ListValue* federations_value = nullptr; |
| 2842 if (!message->GetList("federations", &federations_value)) { | 2842 if (!message->GetList("federations", &federations_value)) { |
| 2843 DLOG(WARNING) << "JS message parameter not found: federations"; | 2843 DLOG(WARNING) << "JS message parameter not found: federations"; |
| 2844 return NO; | 2844 return NO; |
| 2845 } | 2845 } |
| 2846 std::vector<std::string> federations; | 2846 std::vector<std::string> federations; |
| 2847 for (auto federation_value : *federations_value) { | 2847 for (const auto& federation_value : *federations_value) { |
| 2848 std::string federation; | 2848 std::string federation; |
| 2849 if (!federation_value->GetAsString(&federation)) { | 2849 if (!federation_value->GetAsString(&federation)) { |
| 2850 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; | 2850 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; |
| 2851 return NO; | 2851 return NO; |
| 2852 } | 2852 } |
| 2853 federations.push_back(federation); | 2853 federations.push_back(federation); |
| 2854 } | 2854 } |
| 2855 DCHECK(context[web::kUserIsInteractingKey]); | 2855 DCHECK(context[web::kUserIsInteractingKey]); |
| 2856 _webStateImpl->OnCredentialsRequested( | 2856 _webStateImpl->OnCredentialsRequested( |
| 2857 request_id, net::GURLWithNSURL(context[web::kOriginURLKey]), unmediated, | 2857 request_id, net::GURLWithNSURL(context[web::kOriginURLKey]), unmediated, |
| (...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5559 } | 5559 } |
| 5560 | 5560 |
| 5561 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5561 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5562 } | 5562 } |
| 5563 | 5563 |
| 5564 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5564 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5565 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5565 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5566 } | 5566 } |
| 5567 | 5567 |
| 5568 @end | 5568 @end |
| OLD | NEW |