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