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

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

Issue 1851003003: [ios] Added web// public API to let embedder observe loading progress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation Created 4 years, 8 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/web/shell/view_controller.mm ('k') | ios/web/web_state/web_state_delegate.mm » ('j') | 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 <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after
4949 ofObject:(id)object 4949 ofObject:(id)object
4950 change:(NSDictionary*)change 4950 change:(NSDictionary*)change
4951 context:(void*)context { 4951 context:(void*)context {
4952 NSString* dispatcherSelectorName = self.WKWebViewObservers[keyPath]; 4952 NSString* dispatcherSelectorName = self.WKWebViewObservers[keyPath];
4953 DCHECK(dispatcherSelectorName); 4953 DCHECK(dispatcherSelectorName);
4954 if (dispatcherSelectorName) 4954 if (dispatcherSelectorName)
4955 [self performSelector:NSSelectorFromString(dispatcherSelectorName)]; 4955 [self performSelector:NSSelectorFromString(dispatcherSelectorName)];
4956 } 4956 }
4957 4957
4958 - (void)webViewEstimatedProgressDidChange { 4958 - (void)webViewEstimatedProgressDidChange {
4959 if ([self.delegate 4959 if ([self isBeingDestroyed])
4960 return;
4961
4962 self.webStateImpl->SendChangeLoadProgress([_webView estimatedProgress]);
4963 if ([_delegate
4960 respondsToSelector:@selector(webController:didUpdateProgress:)]) { 4964 respondsToSelector:@selector(webController:didUpdateProgress:)]) {
4961 [self.delegate webController:self 4965 [_delegate webController:self
4962 didUpdateProgress:[self.webView estimatedProgress]]; 4966 didUpdateProgress:[_webView estimatedProgress]];
4963 } 4967 }
4964 } 4968 }
4965 4969
4966 - (void)webViewSecurityFeaturesDidChange { 4970 - (void)webViewSecurityFeaturesDidChange {
4967 if (self.loadPhase == web::LOAD_REQUESTED) { 4971 if (self.loadPhase == web::LOAD_REQUESTED) {
4968 // Do not update SSL Status for pending load. It will be updated in 4972 // Do not update SSL Status for pending load. It will be updated in
4969 // |webView:didCommitNavigation:| callback. 4973 // |webView:didCommitNavigation:| callback.
4970 return; 4974 return;
4971 } 4975 }
4972 [self updateSSLStatusForCurrentNavigationItem]; 4976 [self updateSSLStatusForCurrentNavigationItem];
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
5258 } 5262 }
5259 5263
5260 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5264 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5261 } 5265 }
5262 5266
5263 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5267 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5264 return [action.request valueForHTTPHeaderField:@"Referer"]; 5268 return [action.request valueForHTTPHeaderField:@"Referer"];
5265 } 5269 }
5266 5270
5267 @end 5271 @end
OLDNEW
« no previous file with comments | « ios/web/shell/view_controller.mm ('k') | ios/web/web_state/web_state_delegate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698