| 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 // TODO(vsm): Unify with Dartium version. | 5 // TODO(vsm): Unify with Dartium version. |
| 6 class _DOMWindowCrossFrameImpl implements Window { | 6 class _DOMWindowCrossFrameImpl implements Window { |
| 7 // Private window. Note, this is a window in another frame, so it | 7 // Private window. Note, this is a window in another frame, so it |
| 8 // cannot be typed as "Window" as its prototype is not patched | 8 // cannot be typed as "Window" as its prototype is not patched |
| 9 // properly. Its fields and methods can only be accessed via JavaScript. | 9 // properly. Its fields and methods can only be accessed via JavaScript. |
| 10 var _window; | 10 var _window; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 class _LocationCrossFrameImpl implements Location { | 58 class _LocationCrossFrameImpl implements Location { |
| 59 // Private location. Note, this is a location object in another frame, so it | 59 // Private location. Note, this is a location object in another frame, so it |
| 60 // cannot be typed as "Location" as its prototype is not patched | 60 // cannot be typed as "Location" as its prototype is not patched |
| 61 // properly. Its fields and methods can only be accessed via JavaScript. | 61 // properly. Its fields and methods can only be accessed via JavaScript. |
| 62 var _location; | 62 var _location; |
| 63 | 63 |
| 64 void set href(String val) => _setHref(_location, val); | 64 void set href(String val) => _setHref(_location, val); |
| 65 static void _setHref(location, val) { | 65 static void _setHref(location, val) { |
| 66 JS('void', '#.href = #', _location, val); | 66 JS('void', '#.href = #', location, val); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Implementation support. | 69 // Implementation support. |
| 70 _LocationCrossFrameImpl(this._location); | 70 _LocationCrossFrameImpl(this._location); |
| 71 | 71 |
| 72 static Location _createSafe(location) { | 72 static Location _createSafe(location) { |
| 73 if (location === window.location) { | 73 if (location === window.location) { |
| 74 return location; | 74 return location; |
| 75 } else { | 75 } else { |
| 76 // TODO(vsm): Cache or implement equality. | 76 // TODO(vsm): Cache or implement equality. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 static History _createSafe(h) { | 97 static History _createSafe(h) { |
| 98 if (h === window.history) { | 98 if (h === window.history) { |
| 99 return h; | 99 return h; |
| 100 } else { | 100 } else { |
| 101 // TODO(vsm): Cache or implement equality. | 101 // TODO(vsm): Cache or implement equality. |
| 102 return new _HistoryCrossFrameImpl(h); | 102 return new _HistoryCrossFrameImpl(h); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 } | 105 } |
| OLD | NEW |