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

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

Issue 2901633002: Replaced NavigationContext::IsErrorPage with NavigationContext::GetError (Closed)
Patch Set: Created 3 years, 7 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h" 74 #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h"
75 #include "ios/web/public/web_state/url_verification_constants.h" 75 #include "ios/web/public/web_state/url_verification_constants.h"
76 #import "ios/web/public/web_state/web_state.h" 76 #import "ios/web/public/web_state/web_state.h"
77 #include "ios/web/public/web_state/web_state_interface_provider.h" 77 #include "ios/web/public/web_state/web_state_interface_provider.h"
78 #include "ios/web/public/webui/web_ui_ios.h" 78 #include "ios/web/public/webui/web_ui_ios.h"
79 #import "ios/web/web_state/crw_pass_kit_downloader.h" 79 #import "ios/web/web_state/crw_pass_kit_downloader.h"
80 #import "ios/web/web_state/error_translation_util.h" 80 #import "ios/web/web_state/error_translation_util.h"
81 #import "ios/web/web_state/js/crw_js_plugin_placeholder_manager.h" 81 #import "ios/web/web_state/js/crw_js_plugin_placeholder_manager.h"
82 #import "ios/web/web_state/js/crw_js_post_request_loader.h" 82 #import "ios/web/web_state/js/crw_js_post_request_loader.h"
83 #import "ios/web/web_state/js/crw_js_window_id_manager.h" 83 #import "ios/web/web_state/js/crw_js_window_id_manager.h"
84 #include "ios/web/web_state/navigation_context_impl.h" 84 #import "ios/web/web_state/navigation_context_impl.h"
85 #import "ios/web/web_state/page_viewport_state.h" 85 #import "ios/web/web_state/page_viewport_state.h"
86 #import "ios/web/web_state/ui/crw_context_menu_controller.h" 86 #import "ios/web/web_state/ui/crw_context_menu_controller.h"
87 #import "ios/web/web_state/ui/crw_swipe_recognizer_provider.h" 87 #import "ios/web/web_state/ui/crw_swipe_recognizer_provider.h"
88 #import "ios/web/web_state/ui/crw_web_controller.h" 88 #import "ios/web/web_state/ui/crw_web_controller.h"
89 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" 89 #import "ios/web/web_state/ui/crw_web_controller_container_view.h"
90 #import "ios/web/web_state/ui/crw_web_view_proxy_impl.h" 90 #import "ios/web/web_state/ui/crw_web_view_proxy_impl.h"
91 #import "ios/web/web_state/ui/crw_wk_navigation_states.h" 91 #import "ios/web/web_state/ui/crw_wk_navigation_states.h"
92 #import "ios/web/web_state/ui/crw_wk_script_message_router.h" 92 #import "ios/web/web_state/ui/crw_wk_script_message_router.h"
93 #import "ios/web/web_state/ui/wk_back_forward_list_item_holder.h" 93 #import "ios/web/web_state/ui/wk_back_forward_list_item_holder.h"
94 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" 94 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
(...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 web::NavigationManager* navManager = self.webState->GetNavigationManager(); 3095 web::NavigationManager* navManager = self.webState->GetNavigationManager();
3096 if (navManager->GetLastCommittedItem() && [error code] != NSURLErrorCancelled) 3096 if (navManager->GetLastCommittedItem() && [error code] != NSURLErrorCancelled)
3097 navManager->GetLastCommittedItem()->GetSSL() = web::SSLStatus(); 3097 navManager->GetLastCommittedItem()->GetSSL() = web::SSLStatus();
3098 3098
3099 NSURL* errorURL = [NSURL 3099 NSURL* errorURL = [NSURL
3100 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]]; 3100 URLWithString:[userInfo objectForKey:NSURLErrorFailingURLStringErrorKey]];
3101 const GURL errorGURL = net::GURLWithNSURL(errorURL); 3101 const GURL errorGURL = net::GURLWithNSURL(errorURL);
3102 3102
3103 web::NavigationContextImpl* navigationContext = 3103 web::NavigationContextImpl* navigationContext =
3104 [_navigationStates contextForNavigation:navigation]; 3104 [_navigationStates contextForNavigation:navigation];
3105 navigationContext->SetIsErrorPage(true); 3105 navigationContext->SetError(error);
3106 3106
3107 // Handles Frame Load Interrupted errors from WebView. 3107 // Handles Frame Load Interrupted errors from WebView.
3108 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] && 3108 if ([error.domain isEqual:base::SysUTF8ToNSString(web::kWebKitErrorDomain)] &&
3109 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) { 3109 error.code == web::kWebKitErrorFrameLoadInterruptedByPolicyChange) {
3110 // See if the delegate wants to handle this case. 3110 // See if the delegate wants to handle this case.
3111 if (errorGURL.is_valid() && 3111 if (errorGURL.is_valid() &&
3112 [_delegate 3112 [_delegate
3113 respondsToSelector:@selector( 3113 respondsToSelector:@selector(
3114 controllerForUnhandledContentAtURL:)]) { 3114 controllerForUnhandledContentAtURL:)]) {
3115 id<CRWNativeContent> controller = 3115 id<CRWNativeContent> controller =
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 - (NSUInteger)observerCount { 5220 - (NSUInteger)observerCount {
5221 DCHECK_EQ(_observerBridges.size(), [_observers count]); 5221 DCHECK_EQ(_observerBridges.size(), [_observers count]);
5222 return [_observers count]; 5222 return [_observers count];
5223 } 5223 }
5224 5224
5225 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5225 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5226 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5226 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5227 } 5227 }
5228 5228
5229 @end 5229 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/ui/crw_wk_navigation_states.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698