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

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

Issue 1029983002: Upstream ios/web/ JS files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
Index: ios/web/web_state/js/resources/core_dynamic_wk.js
diff --git a/ios/web/web_state/js/resources/core_dynamic_wk.js b/ios/web/web_state/js/resources/core_dynamic_wk.js
new file mode 100644
index 0000000000000000000000000000000000000000..dd91478774521590971eedeffb0eff541bd5cc23
--- /dev/null
+++ b/ios/web/web_state/js/resources/core_dynamic_wk.js
@@ -0,0 +1,59 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Scripts that are conceptually part of core.js, but have WKWebView-specific
+// details/behaviors.
+
+goog.provide('__crweb.core_dynamic_wk');
+
+/**
+ * Namespace for this module.
+ */
+__gCrWeb.core_dynamic = {};
+
+/* Beginning of anonymous object. */
+new function() {
+ /**
+ * Adds WKWebView specific event listeners.
+ */
+ __gCrWeb.core_dynamic.addEventListeners = function() {
+ // So far there are no WKWebView specific event listeners.
+ };
+
+ /**
+ * Applies WKWebView specific document-level overrides. Script injection for
+ * WKWebView always happens after the document is presented; therefore, there
+ * is no need to provide for invoking documentInject at a later time.
+ */
+ __gCrWeb.core_dynamic.documentInject = function() {
+ // Flush the message queue.
+ if (__gCrWeb.message) {
+ __gCrWeb.message.invokeQueues();
+ }
+ return true;
+ };
+
+ /**
+ * Handles document load completion tasks. Invoked from
+ * [WKNavigationDelegate webView:didFinishNavigation:], when document load is
+ * complete.
+ */
+ __gCrWeb.didFinishNavigation = function() {
+ // 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'});
+ }
+
+ /**
+ * Sends window.history.willChangeState message. Called when
+ * history.pushState and history.replaceState are invoked.
+ */
+ __gCrWeb.core_dynamic.historyWillChangeState = function() {
+ __gCrWeb.message.invokeOnHost(
+ {'command': 'window.history.willChangeState'});
+ };
+}
« no previous file with comments | « ios/web/web_state/js/resources/core_dynamic_ui.js ('k') | ios/web/web_state/js/resources/dialog_overrides.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698