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

Unified Diff: ios/web/web_state/js/resources/navigation.js

Issue 2810263002: Deprecate __gCrWeb['sendFaviconsToHost'] by inlining it. (Closed)
Patch Set: add missing goog.require 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/js/resources/core.js ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/resources/navigation.js
diff --git a/ios/web/web_state/js/resources/navigation.js b/ios/web/web_state/js/resources/navigation.js
index 4e299d553316b37fc7be88697bb9eea167018342..325d09184f269e2e6548a06b492d1349105a100c 100644
--- a/ios/web/web_state/js/resources/navigation.js
+++ b/ios/web/web_state/js/resources/navigation.js
@@ -8,6 +8,7 @@
goog.provide('__crWeb.navigation');
+goog.require('__crWeb.common');
goog.require('__crWeb.message');
/** Beginning of anonymouse object */
@@ -66,6 +67,21 @@ goog.require('__crWeb.message');
};
/**
+ * Handles document load completion tasks. Invoked from
+ * [WKNavigationDelegate webView:didFinishNavigation:], when document load is
+ * complete.
+ */
+ __gCrWeb.didFinishNavigation = function() {
Eugene But (OOO till 7-30) 2017/04/12 21:33:08 Do you want to move this to legacy.js instead?
+ // Send the favicons to the browser.
+ __gCrWeb.message.invokeOnHost({'command': 'document.favicons',
+ 'favicons': __gCrWeb.common.getFavicons()});
+
+ // Add placeholders for plugin content.
+ if (__gCrWeb.common.updatePluginPlaceholders())
+ __gCrWeb.message.invokeOnHost({'command': 'addPluginPlaceholders'});
+ }
+
+ /**
* Intercept window.history methods to call back/forward natively.
*/
window.history.back = function() {
@@ -117,6 +133,11 @@ goog.require('__crWeb.message');
};
window.addEventListener('hashchange', function(evt) {
+ // Because hash changes don't trigger __gCrWeb.didFinishNavigation, so fetch
+ // favicons for the new page manually.
+ __gCrWeb.message.invokeOnHost({'command': 'document.favicons',
+ 'favicons': __gCrWeb.common.getFavicons()});
+
__gCrWeb.message.invokeOnHost({'command': 'window.hashchange'});
});
« no previous file with comments | « ios/web/web_state/js/resources/core.js ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698