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

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

Issue 2165443002: [ios] Reset SSLStatus to default when navigation fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GetLastCommittedItem() can be nil Created 4 years, 5 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 | « no previous file | 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 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after
3429 _lastUserInteraction->time > _lastTransferTimeInSeconds && 3429 _lastUserInteraction->time > _lastTransferTimeInSeconds &&
3430 timeSinceInteraction >= 0.0; 3430 timeSinceInteraction >= 0.0;
3431 } else { 3431 } else {
3432 // If the error does not have timing information, check if the user 3432 // If the error does not have timing information, check if the user
3433 // interacted with the page recently. 3433 // interacted with the page recently.
3434 userInteracted = [self userIsInteracting]; 3434 userInteracted = [self userIsInteracting];
3435 } 3435 }
3436 if (!inMainFrame && !userInteracted) 3436 if (!inMainFrame && !userInteracted)
3437 return; 3437 return;
3438 3438
3439 // Reset SSL status to default.
3440 web::NavigationManager* navManager = self.webState->GetNavigationManager();
3441 if (navManager->GetLastCommittedItem())
3442 navManager->GetLastCommittedItem()->GetSSL() = web::SSLStatus();
3443
3439 NSURL* errorURL = [NSURL 3444 NSURL* errorURL = [NSURL
3440 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]]; 3445 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]];
3441 const GURL errorGURL = net::GURLWithNSURL(errorURL); 3446 const GURL errorGURL = net::GURLWithNSURL(errorURL);
3442 3447
3443 // Handles Frame Load Interrupted errors from WebView. 3448 // Handles Frame Load Interrupted errors from WebView.
3444 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] && 3449 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] &&
3445 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) { 3450 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) {
3446 // See if the delegate wants to handle this case. 3451 // See if the delegate wants to handle this case.
3447 if (errorGURL.is_valid() && 3452 if (errorGURL.is_valid() &&
3448 [_delegate 3453 [_delegate
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 } 5655 }
5651 5656
5652 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5657 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5653 } 5658 }
5654 5659
5655 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5660 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5656 return [action.request valueForHTTPHeaderField:@"Referer"]; 5661 return [action.request valueForHTTPHeaderField:@"Referer"];
5657 } 5662 }
5658 5663
5659 @end 5664 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698