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

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

Issue 2810263002: Deprecate __gCrWeb['sendFaviconsToHost'] by inlining it. (Closed)
Patch Set: Moved didFinishNavigation to legacy.js Created 3 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/web_state/js/resources/web_bundle.js ('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 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 DLOG(WARNING) << "JS message parameter not found: message"; 2675 DLOG(WARNING) << "JS message parameter not found: message";
2676 return NO; 2676 return NO;
2677 } 2677 }
2678 DLOG(ERROR) << "JavaScript error: " << errorMessage 2678 DLOG(ERROR) << "JavaScript error: " << errorMessage
2679 << " URL:" << [self currentURL].spec(); 2679 << " URL:" << [self currentURL].spec();
2680 return YES; 2680 return YES;
2681 } 2681 }
2682 2682
2683 - (BOOL)handleWindowHashChangeMessage:(base::DictionaryValue*)message 2683 - (BOOL)handleWindowHashChangeMessage:(base::DictionaryValue*)message
2684 context:(NSDictionary*)context { 2684 context:(NSDictionary*)context {
2685 // Because hash changes don't trigger |-didFinishNavigation|, fetch favicons
2686 // for the new page manually.
2687 [self executeJavaScript:@"__gCrWeb.sendFaviconsToHost();"
2688 completionHandler:nil];
2689
2690 // Record that the current NavigationItem was created by a hash change, but 2685 // Record that the current NavigationItem was created by a hash change, but
2691 // ignore hashchange events that are manually dispatched for same-document 2686 // ignore hashchange events that are manually dispatched for same-document
2692 // navigations. 2687 // navigations.
2693 if (_dispatchingSameDocumentHashChangeEvent) { 2688 if (_dispatchingSameDocumentHashChangeEvent) {
2694 _dispatchingSameDocumentHashChangeEvent = NO; 2689 _dispatchingSameDocumentHashChangeEvent = NO;
2695 } else { 2690 } else {
2696 web::NavigationItemImpl* item = self.currentNavItem; 2691 web::NavigationItemImpl* item = self.currentNavItem;
2697 DCHECK(item); 2692 DCHECK(item);
2698 item->SetIsCreatedFromHashChange(true); 2693 item->SetIsCreatedFromHashChange(true);
2699 } 2694 }
(...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after
5070 - (void)simulateLoadRequestWithURL:(const GURL&)URL { 5065 - (void)simulateLoadRequestWithURL:(const GURL&)URL {
5071 _lastRegisteredRequestURL = URL; 5066 _lastRegisteredRequestURL = URL;
5072 _loadPhase = web::LOAD_REQUESTED; 5067 _loadPhase = web::LOAD_REQUESTED;
5073 } 5068 }
5074 5069
5075 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5070 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5076 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5071 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5077 } 5072 }
5078 5073
5079 @end 5074 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/js/resources/web_bundle.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698