| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var eventBindingsNatives = requireNative('event_bindings'); | 5 var chrome = chrome || {}; |
| 6 var AttachEvent = eventBindingsNatives.AttachEvent; | 6 (function () { |
| 7 var DetachEvent = eventBindingsNatives.DetachEvent; | 7 native function GetChromeHidden(); |
| 8 var Print = eventBindingsNatives.Print; | 8 native function AttachEvent(eventName); |
| 9 native function DetachEvent(eventName, manual); |
| 10 native function Print(); |
| 9 | 11 |
| 10 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 12 var chromeHidden = GetChromeHidden(); |
| 11 | 13 |
| 12 // Local implementation of JSON.parse & JSON.stringify that protect us | 14 // Local implementation of JSON.parse & JSON.stringify that protect us |
| 13 // from being clobbered by an extension. | 15 // from being clobbered by an extension. |
| 14 // | 16 // |
| 15 // TODO(aa): This makes me so sad. We shouldn't need it, as we can just pass | 17 // TODO(aa): This makes me so sad. We shouldn't need it, as we can just pass |
| 16 // Values directly over IPC without serializing to strings and use | 18 // Values directly over IPC without serializing to strings and use |
| 17 // JSONValueConverter. | 19 // JSONValueConverter. |
| 18 chromeHidden.JSON = new (function() { | 20 chromeHidden.JSON = new (function() { |
| 19 var $Object = Object; | 21 var $Object = Object; |
| 20 var $Array = Array; | 22 var $Array = Array; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 for (var i = 0; i < allAttachedEvents.length; ++i) { | 304 for (var i = 0; i < allAttachedEvents.length; ++i) { |
| 303 var event = allAttachedEvents[i]; | 305 var event = allAttachedEvents[i]; |
| 304 if (event) | 306 if (event) |
| 305 event.detach_(false); | 307 event.detach_(false); |
| 306 } | 308 } |
| 307 }; | 309 }; |
| 308 | 310 |
| 309 chromeHidden.dispatchError = function(msg) { | 311 chromeHidden.dispatchError = function(msg) { |
| 310 console.error(msg); | 312 console.error(msg); |
| 311 }; | 313 }; |
| 314 })(); |
| OLD | NEW |