Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2772723006: Do not suppress HTTP Authenticaiton in WebController. (Closed)
Patch Set: Updated comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after
3291 - (void)handleHTTPAuthForChallenge:(NSURLAuthenticationChallenge*)challenge 3291 - (void)handleHTTPAuthForChallenge:(NSURLAuthenticationChallenge*)challenge
3292 completionHandler: 3292 completionHandler:
3293 (void (^)(NSURLSessionAuthChallengeDisposition, 3293 (void (^)(NSURLSessionAuthChallengeDisposition,
3294 NSURLCredential*))completionHandler { 3294 NSURLCredential*))completionHandler {
3295 NSURLProtectionSpace* space = challenge.protectionSpace; 3295 NSURLProtectionSpace* space = challenge.protectionSpace;
3296 DCHECK( 3296 DCHECK(
3297 [space.authenticationMethod isEqual:NSURLAuthenticationMethodHTTPBasic] || 3297 [space.authenticationMethod isEqual:NSURLAuthenticationMethodHTTPBasic] ||
3298 [space.authenticationMethod isEqual:NSURLAuthenticationMethodNTLM] || 3298 [space.authenticationMethod isEqual:NSURLAuthenticationMethodNTLM] ||
3299 [space.authenticationMethod isEqual:NSURLAuthenticationMethodHTTPDigest]); 3299 [space.authenticationMethod isEqual:NSURLAuthenticationMethodHTTPDigest]);
3300 3300
3301 if (self.shouldSuppressDialogs) {
3302 // TODO(crbug.com/702381): Web Controller should not assume that embedder
3303 // handles HTTP Authentication by showing the dialog.
3304 _webStateImpl->OnDialogSuppressed();
3305 completionHandler(NSURLSessionAuthChallengeRejectProtectionSpace, nil);
3306 return;
3307 }
3308
3309 _webStateImpl->OnAuthRequired( 3301 _webStateImpl->OnAuthRequired(
3310 space, challenge.proposedCredential, 3302 space, challenge.proposedCredential,
3311 base::BindBlock(^(NSString* user, NSString* password) { 3303 base::BindBlock(^(NSString* user, NSString* password) {
3312 [CRWWebController processHTTPAuthForUser:user 3304 [CRWWebController processHTTPAuthForUser:user
3313 password:password 3305 password:password
3314 completionHandler:completionHandler]; 3306 completionHandler:completionHandler];
3315 })); 3307 }));
3316 } 3308 }
3317 3309
3318 + (void)processHTTPAuthForUser:(NSString*)user 3310 + (void)processHTTPAuthForUser:(NSString*)user
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
5094 - (void)simulateLoadRequestWithURL:(const GURL&)URL { 5086 - (void)simulateLoadRequestWithURL:(const GURL&)URL {
5095 _lastRegisteredRequestURL = URL; 5087 _lastRegisteredRequestURL = URL;
5096 _loadPhase = web::LOAD_REQUESTED; 5088 _loadPhase = web::LOAD_REQUESTED;
5097 } 5089 }
5098 5090
5099 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5091 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5100 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5092 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5101 } 5093 }
5102 5094
5103 @end 5095 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698