OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 This file contains a helper object to wrap an instance of | 6 * @fileoverview This file contains a helper object to wrap an instance of |
7 * ChromeFrame for a given top-level window in Firefox. The main functions of | 7 * ChromeFrame for a given top-level window in Firefox. The main functions of |
8 * this object are to initialize ChromeFrame and properly handle queueing of | 8 * this object are to initialize ChromeFrame and properly handle queueing of |
9 * messages sent to. | 9 * messages sent to. |
10 * | 10 * |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 * Queue of pending messages to be sent to ChromeFrame once it becomes ready. | 42 * Queue of pending messages to be sent to ChromeFrame once it becomes ready. |
43 */ | 43 */ |
44 this.queue_ = []; | 44 this.queue_ = []; |
45 | 45 |
46 /** | 46 /** |
47 * A reference to the parent element (the toolbar) of the cf_ node. | 47 * A reference to the parent element (the toolbar) of the cf_ node. |
48 */ | 48 */ |
49 this.parent_ = null; | 49 this.parent_ = null; |
50 } | 50 } |
51 | 51 |
52 /** | |
53 * Value used for id attribute of the ChromeFrame <embed> element. | |
54 * @const | |
55 */ | |
56 CfHelper.prototype.CHROME_FRAME_ID = 'ceee-browser'; | |
57 | |
58 /** Origin for use with postPrivateMessage. @const */ | 52 /** Origin for use with postPrivateMessage. @const */ |
59 CfHelper.prototype.ORIGIN_EXTENSION = '__priv_xtapi'; | 53 CfHelper.prototype.ORIGIN_EXTENSION = '__priv_xtapi'; |
60 | 54 |
61 /** Target for event notifications. @const */ | 55 /** Target for event notifications. @const */ |
62 CfHelper.prototype.TARGET_EVENT_REQUEST = '__priv_evtreq'; | 56 CfHelper.prototype.TARGET_EVENT_REQUEST = '__priv_evtreq'; |
63 | 57 |
64 /** Target for responses to Chrome Extension API requests. @const */ | 58 /** Target for responses to Chrome Extension API requests. @const */ |
65 CfHelper.prototype.TARGET_API_RESPONSE = '__priv_xtres'; | 59 CfHelper.prototype.TARGET_API_RESPONSE = '__priv_xtres'; |
66 | 60 |
67 /** Target for message port requests. @const */ | 61 /** Target for message port requests. @const */ |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 /** | 228 /** |
235 * Handle 'embed' element ready state events. | 229 * Handle 'embed' element ready state events. |
236 * @private | 230 * @private |
237 */ | 231 */ |
238 CfHelper.prototype.onReadyStateChange_ = function() { | 232 CfHelper.prototype.onReadyStateChange_ = function() { |
239 this.ceee_.logInfo('CfHelper.readystatechange: state=' + | 233 this.ceee_.logInfo('CfHelper.readystatechange: state=' + |
240 this.cf_.readystate); | 234 this.cf_.readystate); |
241 if (this.cf_.readystate == READY_STATE_UNINITIALIZED) { | 235 if (this.cf_.readystate == READY_STATE_UNINITIALIZED) { |
242 this.cf_.style.visibility = 'hidden'; | 236 this.cf_.style.visibility = 'hidden'; |
243 } else if (this.cf_.readystate == READY_STATE_COMPLETED) { | 237 } else if (this.cf_.readystate == READY_STATE_COMPLETED) { |
| 238 this.ceee_.logInfo('CfHelper.readystatechange: window=' + |
| 239 CEEE_mozilla_windows.getWindowId(window) + |
| 240 ' cf=' + this.cf_.sessionid); |
| 241 |
244 // Do this before we even load the extension at the other end so | 242 // Do this before we even load the extension at the other end so |
245 // that extension automation is set up before any background pages | 243 // that extension automation is set up before any background pages |
246 // in the extension load. | 244 // in the extension load. |
247 CEEE_globals.masterCf.onChromeFrameReady(this.cf_, | 245 CEEE_globals.masterCf.onChromeFrameReady(this.cf_, |
248 this.ceee_.logInfo); | 246 this.ceee_.logInfo); |
249 | 247 |
250 // TODO(ibazarny@google.com): Not every chrome frame needs to load | 248 // TODO(ibazarny@google.com): Not every chrome frame needs to load |
251 // extensions. However, I don't know how to make it | 249 // extensions. However, I don't know how to make it |
252 // work. Should be something like: | 250 // work. Should be something like: |
253 //if (!loadExtensions) { | 251 //if (!loadExtensions) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 this.cf_.style.visibility = 'visible'; | 362 this.cf_.style.visibility = 'visible'; |
365 this.isReady_ = true; | 363 this.isReady_ = true; |
366 this.postPendingMessages_(); | 364 this.postPendingMessages_(); |
367 onCfReady(); | 365 onCfReady(); |
368 }; | 366 }; |
369 | 367 |
370 // Make the constructor visible outside this anonymous block. | 368 // Make the constructor visible outside this anonymous block. |
371 CEEE_CfHelper = CfHelper; | 369 CEEE_CfHelper = CfHelper; |
372 | 370 |
373 })(); | 371 })(); |
OLD | NEW |