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