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 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2610 return NO; | 2610 return NO; |
2611 } | 2611 } |
2612 base::ListValue* federations_value = nullptr; | 2612 base::ListValue* federations_value = nullptr; |
2613 if (!message->GetList("federations", &federations_value)) { | 2613 if (!message->GetList("federations", &federations_value)) { |
2614 DLOG(WARNING) << "JS message parameter not found: federations"; | 2614 DLOG(WARNING) << "JS message parameter not found: federations"; |
2615 return NO; | 2615 return NO; |
2616 } | 2616 } |
2617 std::vector<std::string> federations; | 2617 std::vector<std::string> federations; |
2618 for (const auto& federation_value : *federations_value) { | 2618 for (const auto& federation_value : *federations_value) { |
2619 std::string federation; | 2619 std::string federation; |
2620 if (!federation_value->GetAsString(&federation)) { | 2620 if (!federation_value.GetAsString(&federation)) { |
2621 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; | 2621 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; |
2622 return NO; | 2622 return NO; |
2623 } | 2623 } |
2624 federations.push_back(federation); | 2624 federations.push_back(federation); |
2625 } | 2625 } |
2626 DCHECK(context[kUserIsInteractingKey]); | 2626 DCHECK(context[kUserIsInteractingKey]); |
2627 _webStateImpl->OnCredentialsRequested( | 2627 _webStateImpl->OnCredentialsRequested( |
2628 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), | 2628 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), |
2629 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); | 2629 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); |
2630 return YES; | 2630 return YES; |
(...skipping 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5095 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5095 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
5096 _lastRegisteredRequestURL = URL; | 5096 _lastRegisteredRequestURL = URL; |
5097 _loadPhase = web::LOAD_REQUESTED; | 5097 _loadPhase = web::LOAD_REQUESTED; |
5098 } | 5098 } |
5099 | 5099 |
5100 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5100 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
5101 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5101 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
5102 } | 5102 } |
5103 | 5103 |
5104 @end | 5104 @end |
OLD | NEW |