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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } else { | 50 } else { |
51 // TODO(vsm): Cache or implement equality. | 51 // TODO(vsm): Cache or implement equality. |
52 return new _DOMWindowCrossFrame(w); | 52 return new _DOMWindowCrossFrame(w); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 // TODO(efortuna): Remove this method. dartbug.com/16814 | 56 // TODO(efortuna): Remove this method. dartbug.com/16814 |
57 Events get on => throw new UnsupportedError( | 57 Events get on => throw new UnsupportedError( |
58 'You can only attach EventListeners to your own window.'); | 58 'You can only attach EventListeners to your own window.'); |
59 // TODO(efortuna): Remove this method. dartbug.com/16814 | 59 // TODO(efortuna): Remove this method. dartbug.com/16814 |
60 void _addEventListener([String type, EventListener listener, bool useCapture]) | 60 void _addEventListener(String type, EventListener listener, [bool useCapture]) |
61 => throw new UnsupportedError( | 61 => throw new UnsupportedError( |
62 'You can only attach EventListeners to your own window.'); | 62 'You can only attach EventListeners to your own window.'); |
63 // TODO(efortuna): Remove this method. dartbug.com/16814 | 63 // TODO(efortuna): Remove this method. dartbug.com/16814 |
64 void addEventListener(String type, EventListener listener, [bool useCapture]) | 64 void addEventListener(String type, EventListener listener, [bool useCapture]) |
65 => throw new UnsupportedError( | 65 => throw new UnsupportedError( |
66 'You can only attach EventListeners to your own window.'); | 66 'You can only attach EventListeners to your own window.'); |
67 // TODO(efortuna): Remove this method. dartbug.com/16814 | 67 // TODO(efortuna): Remove this method. dartbug.com/16814 |
68 bool dispatchEvent(Event event) => throw new UnsupportedError( | 68 bool dispatchEvent(Event event) => throw new UnsupportedError( |
69 'You can only attach EventListeners to your own window.'); | 69 'You can only attach EventListeners to your own window.'); |
70 // TODO(efortuna): Remove this method. dartbug.com/16814 | 70 // TODO(efortuna): Remove this method. dartbug.com/16814 |
71 void _removeEventListener([String type, EventListener listener, | 71 void _removeEventListener(String type, EventListener listener, |
72 bool useCapture]) => throw new UnsupportedError( | 72 [bool useCapture]) => throw new UnsupportedError( |
73 'You can only attach EventListeners to your own window.'); | 73 'You can only attach EventListeners to your own window.'); |
74 // TODO(efortuna): Remove this method. dartbug.com/16814 | 74 // TODO(efortuna): Remove this method. dartbug.com/16814 |
75 void removeEventListener(String type, EventListener listener, | 75 void removeEventListener(String type, EventListener listener, |
76 [bool useCapture]) => throw new UnsupportedError( | 76 [bool useCapture]) => throw new UnsupportedError( |
77 'You can only attach EventListeners to your own window.'); | 77 'You can only attach EventListeners to your own window.'); |
78 } | 78 } |
79 | 79 |
80 class _LocationCrossFrame implements LocationBase { | 80 class _LocationCrossFrame implements LocationBase { |
81 // Private location. Note, this is a location object in another frame, so it | 81 // Private location. Note, this is a location object in another frame, so it |
82 // cannot be typed as "Location" as its prototype is not patched | 82 // cannot be typed as "Location" as its prototype is not patched |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 static HistoryBase _createSafe(h) { | 119 static HistoryBase _createSafe(h) { |
120 if (identical(h, window.history)) { | 120 if (identical(h, window.history)) { |
121 return h; | 121 return h; |
122 } else { | 122 } else { |
123 // TODO(vsm): Cache or implement equality. | 123 // TODO(vsm): Cache or implement equality. |
124 return new _HistoryCrossFrame(h); | 124 return new _HistoryCrossFrame(h); |
125 } | 125 } |
126 } | 126 } |
127 } | 127 } |
OLD | NEW |