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 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2732 return NO; | 2732 return NO; |
2733 } | 2733 } |
2734 base::ListValue* federations_value = nullptr; | 2734 base::ListValue* federations_value = nullptr; |
2735 if (!message->GetList("federations", &federations_value)) { | 2735 if (!message->GetList("federations", &federations_value)) { |
2736 DLOG(WARNING) << "JS message parameter not found: federations"; | 2736 DLOG(WARNING) << "JS message parameter not found: federations"; |
2737 return NO; | 2737 return NO; |
2738 } | 2738 } |
2739 std::vector<std::string> federations; | 2739 std::vector<std::string> federations; |
2740 for (const auto& federation_value : *federations_value) { | 2740 for (const auto& federation_value : *federations_value) { |
2741 std::string federation; | 2741 std::string federation; |
2742 if (!federation_value->GetAsString(&federation)) { | 2742 if (!federation_value.GetAsString(&federation)) { |
2743 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; | 2743 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; |
2744 return NO; | 2744 return NO; |
2745 } | 2745 } |
2746 federations.push_back(federation); | 2746 federations.push_back(federation); |
2747 } | 2747 } |
2748 DCHECK(context[kUserIsInteractingKey]); | 2748 DCHECK(context[kUserIsInteractingKey]); |
2749 _webStateImpl->OnCredentialsRequested( | 2749 _webStateImpl->OnCredentialsRequested( |
2750 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), | 2750 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), |
2751 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); | 2751 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); |
2752 return YES; | 2752 return YES; |
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5219 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5219 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
5220 _lastRegisteredRequestURL = URL; | 5220 _lastRegisteredRequestURL = URL; |
5221 _loadPhase = web::LOAD_REQUESTED; | 5221 _loadPhase = web::LOAD_REQUESTED; |
5222 } | 5222 } |
5223 | 5223 |
5224 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5224 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
5225 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5225 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
5226 } | 5226 } |
5227 | 5227 |
5228 @end | 5228 @end |
OLD | NEW |