| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of html; | 5 part of html; |
| 6 | 6 |
| 7 // TODO(vsm): Unify with Dartium version. | 7 // TODO(vsm): Unify with Dartium version. |
| 8 class _DOMWindowCrossFrame implements WindowBase { | 8 class _DOMWindowCrossFrame implements WindowBase { |
| 9 // Private window. Note, this is a window in another frame, so it | 9 // Private window. Note, this is a window in another frame, so it |
| 10 // cannot be typed as "Window" as its prototype is not patched | 10 // cannot be typed as "Window" as its prototype is not patched |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 static WindowBase _createSafe(w) { | 44 static WindowBase _createSafe(w) { |
| 45 if (identical(w, window)) { | 45 if (identical(w, window)) { |
| 46 return w; | 46 return w; |
| 47 } else { | 47 } else { |
| 48 // TODO(vsm): Cache or implement equality. | 48 // TODO(vsm): Cache or implement equality. |
| 49 return new _DOMWindowCrossFrame(w); | 49 return new _DOMWindowCrossFrame(w); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 // TODO(efortuna): Remove this method. dartbug.com/16814 | 53 // TODO(efortuna): Remove this method. dartbug.com/16814 |
| 54 Events get on => throw new UnimplementedError(); | 54 Events get on => throw new UnsupportedError( |
| 55 'You can only attach EventListeners to your own window.'); |
| 55 // TODO(efortuna): Remove this method. dartbug.com/16814 | 56 // TODO(efortuna): Remove this method. dartbug.com/16814 |
| 56 void addEventListener(String type, EventListener listener, [bool useCapture]) | 57 void addEventListener(String type, EventListener listener, [bool useCapture]) |
| 57 => throw new UnimplementedError(); | 58 => throw new UnsupportedError( |
| 59 'You can only attach EventListeners to your own window.'); |
| 58 // TODO(efortuna): Remove this method. dartbug.com/16814 | 60 // TODO(efortuna): Remove this method. dartbug.com/16814 |
| 59 bool dispatchEvent(Event event) => throw new UnimplementedError(); | 61 bool dispatchEvent(Event event) => throw new UnsupportedError( |
| 62 'You can only attach EventListeners to your own window.'); |
| 60 // TODO(efortuna): Remove this method. dartbug.com/16814 | 63 // TODO(efortuna): Remove this method. dartbug.com/16814 |
| 61 void removeEventListener(String type, EventListener listener, | 64 void removeEventListener(String type, EventListener listener, |
| 62 [bool useCapture]) => throw new UnimplementedError(); | 65 [bool useCapture]) => throw new UnsupportedError( |
| 66 'You can only attach EventListeners to your own window.'); |
| 63 } | 67 } |
| 64 | 68 |
| 65 class _LocationCrossFrame implements LocationBase { | 69 class _LocationCrossFrame implements LocationBase { |
| 66 // Private location. Note, this is a location object in another frame, so it | 70 // Private location. Note, this is a location object in another frame, so it |
| 67 // cannot be typed as "Location" as its prototype is not patched | 71 // cannot be typed as "Location" as its prototype is not patched |
| 68 // properly. Its fields and methods can only be accessed via JavaScript. | 72 // properly. Its fields and methods can only be accessed via JavaScript. |
| 69 var _location; | 73 var _location; |
| 70 | 74 |
| 71 void set href(String val) => _setHref(_location, val); | 75 void set href(String val) => _setHref(_location, val); |
| 72 static void _setHref(location, val) { | 76 static void _setHref(location, val) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 103 | 107 |
| 104 static HistoryBase _createSafe(h) { | 108 static HistoryBase _createSafe(h) { |
| 105 if (identical(h, window.history)) { | 109 if (identical(h, window.history)) { |
| 106 return h; | 110 return h; |
| 107 } else { | 111 } else { |
| 108 // TODO(vsm): Cache or implement equality. | 112 // TODO(vsm): Cache or implement equality. |
| 109 return new _HistoryCrossFrame(h); | 113 return new _HistoryCrossFrame(h); |
| 110 } | 114 } |
| 111 } | 115 } |
| 112 } | 116 } |
| OLD | NEW |