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

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

Issue 788253002: Upstream injected JavaScript for the iOS web layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug reference Created 6 years 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/message_dynamic_ui.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/resources/message_dynamic_wk.js
diff --git a/ios/web/web_state/js/resources/message_dynamic_wk.js b/ios/web/web_state/js/resources/message_dynamic_wk.js
new file mode 100644
index 0000000000000000000000000000000000000000..644f2fa2c50a6e93a1a33fc45ef944cc748a1998
--- /dev/null
+++ b/ios/web/web_state/js/resources/message_dynamic_wk.js
@@ -0,0 +1,29 @@
+// 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 for the message handler for use with WKWebView.
+
+/**
+ * Namespace for this module.
+ */
+__gCrWeb.message_dynamic = {};
+
+/* Beginning of anonymous object. */
+new function() {
+ /**
+ * Sends queued commands to the Objective-C side.
+ * @param {Object} queueObject Queue object containing messages to send.
+ */
+ __gCrWeb.message_dynamic.sendQueue = function(queueObject) {
+ queueObject.queue.forEach(function(command) {
+ var stringifiedMessage = __gCrWeb.common.JSONStringify({
+ "crwCommand": command,
+ "crwWindowId": __gCrWeb.windowId
+ });
+ window.webkit.messageHandlers[queueObject.scheme].postMessage(
+ stringifiedMessage);
+ });
+ queueObject.reset();
+ };
+}
« no previous file with comments | « ios/web/web_state/js/resources/message_dynamic_ui.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698