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

Side by Side Diff: ios/web/web_state/js/resources/message_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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Scripts for the message handler for use with WKWebView. 5 // Scripts for the message handler for use with WKWebView.
6 6
7 goog.provide('__crweb.message_dynamic_wk');
8
7 /** 9 /**
8 * Namespace for this module. 10 * Namespace for this module.
9 */ 11 */
10 __gCrWeb.message_dynamic = {}; 12 __gCrWeb.message_dynamic = {};
11 13
12 /* Beginning of anonymous object. */ 14 /* Beginning of anonymous object. */
13 new function() { 15 new function() {
14 /** 16 /**
15 * Sends queued commands to the Objective-C side. 17 * Sends queued commands to the Objective-C side.
16 * @param {Object} queueObject Queue object containing messages to send. 18 * @param {Object} queueObject Queue object containing messages to send.
17 */ 19 */
18 __gCrWeb.message_dynamic.sendQueue = function(queueObject) { 20 __gCrWeb.message_dynamic.sendQueue = function(queueObject) {
19 queueObject.queue.forEach(function(command) { 21 queueObject.queue.forEach(function(command) {
20 var stringifiedMessage = __gCrWeb.common.JSONStringify({ 22 var stringifiedMessage = __gCrWeb.common.JSONStringify({
21 "crwCommand": command, 23 "crwCommand": command,
22 "crwWindowId": __gCrWeb.windowId 24 "crwWindowId": __gCrWeb.windowId
23 }); 25 });
24 window.webkit.messageHandlers[queueObject.scheme].postMessage( 26 window.webkit.messageHandlers[queueObject.scheme].postMessage(
25 stringifiedMessage); 27 stringifiedMessage);
26 }); 28 });
27 queueObject.reset(); 29 queueObject.reset();
28 }; 30 };
29 } 31 }
OLDNEW
« no previous file with comments | « ios/web/web_state/js/resources/message_dynamic_ui.js ('k') | ios/web/web_state/js/resources/plugin_placeholder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698