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

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

Issue 1360543004: Manually fetch favicons after hash changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: JSON handler => string handler Created 4 years, 10 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/core_dynamic_wk.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 <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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 } 2419 }
2420 DLOG(ERROR) << "JavaScript error: " << errorMessage 2420 DLOG(ERROR) << "JavaScript error: " << errorMessage
2421 << " URL:" << [self currentURL].spec(); 2421 << " URL:" << [self currentURL].spec();
2422 return YES; 2422 return YES;
2423 } 2423 }
2424 2424
2425 - (BOOL)handleWindowHashChangeMessage:(base::DictionaryValue*)message 2425 - (BOOL)handleWindowHashChangeMessage:(base::DictionaryValue*)message
2426 context:(NSDictionary*)context { 2426 context:(NSDictionary*)context {
2427 [self checkForUnexpectedURLChange]; 2427 [self checkForUnexpectedURLChange];
2428 2428
2429 // Because hash changes don't trigger |-didFinishNavigation|, fetch favicons
2430 // for the new page manually.
2431 [self evaluateJavaScript:@"__gCrWeb.sendFaviconsToHost();"
2432 stringResultHandler:nil];
2433
2429 // Notify the observers. 2434 // Notify the observers.
2430 _webStateImpl->OnUrlHashChanged(); 2435 _webStateImpl->OnUrlHashChanged();
2431 return YES; 2436 return YES;
2432 } 2437 }
2433 2438
2434 - (BOOL)handleWindowHistoryBackMessage:(base::DictionaryValue*)message 2439 - (BOOL)handleWindowHistoryBackMessage:(base::DictionaryValue*)message
2435 context:(NSDictionary*)context { 2440 context:(NSDictionary*)context {
2436 [self goBack]; 2441 [self goBack];
2437 return YES; 2442 return YES;
2438 } 2443 }
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
3910 if ([MIMEType isEqualToString:@"text/html"] || 3915 if ([MIMEType isEqualToString:@"text/html"] ||
3911 [MIMEType isEqualToString:@"application/xhtml+xml"] || 3916 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3912 [MIMEType isEqualToString:@"application/xml"]) { 3917 [MIMEType isEqualToString:@"application/xml"]) {
3913 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; 3918 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3914 } 3919 }
3915 3920
3916 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 3921 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3917 } 3922 }
3918 3923
3919 @end 3924 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/js/resources/core_dynamic_wk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698