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 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 return NO; | 2588 return NO; |
2589 } | 2589 } |
2590 base::ListValue* federations_value = nullptr; | 2590 base::ListValue* federations_value = nullptr; |
2591 if (!message->GetList("federations", &federations_value)) { | 2591 if (!message->GetList("federations", &federations_value)) { |
2592 DLOG(WARNING) << "JS message parameter not found: federations"; | 2592 DLOG(WARNING) << "JS message parameter not found: federations"; |
2593 return NO; | 2593 return NO; |
2594 } | 2594 } |
2595 std::vector<std::string> federations; | 2595 std::vector<std::string> federations; |
2596 for (const auto& federation_value : *federations_value) { | 2596 for (const auto& federation_value : *federations_value) { |
2597 std::string federation; | 2597 std::string federation; |
2598 if (!federation_value.GetAsString(&federation)) { | 2598 if (!federation_value->GetAsString(&federation)) { |
2599 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; | 2599 DLOG(WARNING) << "JS message parameter 'federations' contains wrong type"; |
2600 return NO; | 2600 return NO; |
2601 } | 2601 } |
2602 federations.push_back(federation); | 2602 federations.push_back(federation); |
2603 } | 2603 } |
2604 DCHECK(context[kUserIsInteractingKey]); | 2604 DCHECK(context[kUserIsInteractingKey]); |
2605 _webStateImpl->OnCredentialsRequested( | 2605 _webStateImpl->OnCredentialsRequested( |
2606 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), | 2606 static_cast<int>(request_id), net::GURLWithNSURL(context[kOriginURLKey]), |
2607 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); | 2607 unmediated, federations, [context[kUserIsInteractingKey] boolValue]); |
2608 return YES; | 2608 return YES; |
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5070 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5070 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
5071 _lastRegisteredRequestURL = URL; | 5071 _lastRegisteredRequestURL = URL; |
5072 _loadPhase = web::LOAD_REQUESTED; | 5072 _loadPhase = web::LOAD_REQUESTED; |
5073 } | 5073 } |
5074 | 5074 |
5075 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5075 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
5076 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5076 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
5077 } | 5077 } |
5078 | 5078 |
5079 @end | 5079 @end |
OLD | NEW |