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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js

Issue 2295863002: Remove window.postMessage(message, transferables, targetOrigin) legacy overload (Closed)
Patch Set: leave milestoneString alone Created 4 years, 3 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 | « no previous file | chrome/third_party/chromevox/chromevox/injected/mathjax.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview Public APIs to enable web applications to communicate 6 * @fileoverview Public APIs to enable web applications to communicate
7 * with ChromeVox. 7 * with ChromeVox.
8 */ 8 */
9 9
10 if (typeof(goog) != 'undefined' && goog.provide) { 10 if (typeof(goog) != 'undefined' && goog.provide) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 */ 73 */
74 function connect_() { 74 function connect_() {
75 if (channel) { 75 if (channel) {
76 // If there is already an existing channel, close the existing ports. 76 // If there is already an existing channel, close the existing ports.
77 channel.port1.close(); 77 channel.port1.close();
78 channel.port2.close(); 78 channel.port2.close();
79 channel = null; 79 channel = null;
80 } 80 }
81 81
82 channel = new MessageChannel(); 82 channel = new MessageChannel();
83 window.postMessage(PORT_SETUP_MSG, [channel.port2], '*'); 83 window.postMessage(PORT_SETUP_MSG, '*', [channel.port2]);
84 channel.port1.onmessage = function(event) { 84 channel.port1.onmessage = function(event) {
85 if (event.data == DISCONNECT_MSG) { 85 if (event.data == DISCONNECT_MSG) {
86 channel = null; 86 channel = null;
87 } 87 }
88 try { 88 try {
89 var message = JSON.parse(event.data); 89 var message = JSON.parse(event.data);
90 if (message['id'] && callbackMap_[message['id']]) { 90 if (message['id'] && callbackMap_[message['id']]) {
91 callbackMap_[message['id']](message); 91 callbackMap_[message['id']](message);
92 delete callbackMap_[message['id']]; 92 delete callbackMap_[message['id']];
93 } 93 }
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 */ 569 */
570 // TODO (clchen, deboer): Put NodeDescription into externs for developers 570 // TODO (clchen, deboer): Put NodeDescription into externs for developers
571 // building ChromeVox extensions. 571 // building ChromeVox extensions.
572 cvox.NodeDescription = function(context, text, userValue, annotation) { 572 cvox.NodeDescription = function(context, text, userValue, annotation) {
573 this.context = context ? context : ''; 573 this.context = context ? context : '';
574 this.text = text ? text : ''; 574 this.text = text ? text : '';
575 this.userValue = userValue ? userValue : ''; 575 this.userValue = userValue ? userValue : '';
576 this.annotation = annotation ? annotation : ''; 576 this.annotation = annotation ? annotation : '';
577 }; 577 };
578 })(); 578 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/third_party/chromevox/chromevox/injected/mathjax.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698