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

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

Issue 2286803002: [ios] Do not reset SSL status if load was cancelled. (Closed)
Patch Set: Created 4 years, 3 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 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3406 _lastUserInteraction->time > _lastTransferTimeInSeconds && 3406 _lastUserInteraction->time > _lastTransferTimeInSeconds &&
3407 timeSinceInteraction >= 0.0; 3407 timeSinceInteraction >= 0.0;
3408 } else { 3408 } else {
3409 // If the error does not have timing information, check if the user 3409 // If the error does not have timing information, check if the user
3410 // interacted with the page recently. 3410 // interacted with the page recently.
3411 userInteracted = [self userIsInteracting]; 3411 userInteracted = [self userIsInteracting];
3412 } 3412 }
3413 if (!inMainFrame && !userInteracted) 3413 if (!inMainFrame && !userInteracted)
3414 return; 3414 return;
3415 3415
3416 // Reset SSL status to default. 3416 // Reset SSL status to default, unless the load was cancelled (manually or by
3417 // back-forward navigation).
3417 web::NavigationManager* navManager = self.webState->GetNavigationManager(); 3418 web::NavigationManager* navManager = self.webState->GetNavigationManager();
3418 if (navManager->GetLastCommittedItem()) 3419 if (navManager->GetLastCommittedItem() && [error code] != NSURLErrorCancelled)
3419 navManager->GetLastCommittedItem()->GetSSL() = web::SSLStatus(); 3420 navManager->GetLastCommittedItem()->GetSSL() = web::SSLStatus();
3420 3421
3421 NSURL* errorURL = [NSURL 3422 NSURL* errorURL = [NSURL
3422 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]]; 3423 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]];
3423 const GURL errorGURL = net::GURLWithNSURL(errorURL); 3424 const GURL errorGURL = net::GURLWithNSURL(errorURL);
3424 3425
3425 // Handles Frame Load Interrupted errors from WebView. 3426 // Handles Frame Load Interrupted errors from WebView.
3426 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] && 3427 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] &&
3427 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) { 3428 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) {
3428 // See if the delegate wants to handle this case. 3429 // See if the delegate wants to handle this case.
(...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after
5629 } 5630 }
5630 5631
5631 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5632 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5632 } 5633 }
5633 5634
5634 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5635 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5635 return [action.request valueForHTTPHeaderField:@"Referer"]; 5636 return [action.request valueForHTTPHeaderField:@"Referer"];
5636 } 5637 }
5637 5638
5638 @end 5639 @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