| 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; |
| 6 |
| 5 // TODO(vsm): Unify with Dartium version. | 7 // TODO(vsm): Unify with Dartium version. |
| 6 class _DOMWindowCrossFrame implements Window { | 8 class _DOMWindowCrossFrame implements Window { |
| 7 // 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 |
| 8 // cannot be typed as "Window" as its prototype is not patched | 10 // cannot be typed as "Window" as its prototype is not patched |
| 9 // properly. Its fields and methods can only be accessed via JavaScript. | 11 // properly. Its fields and methods can only be accessed via JavaScript. |
| 10 var _window; | 12 var _window; |
| 11 | 13 |
| 12 // Fields. | 14 // Fields. |
| 13 History get history => | 15 History get history => |
| 14 _HistoryCrossFrame._createSafe(JS('History', '#.history', _window)); | 16 _HistoryCrossFrame._createSafe(JS('History', '#.history', _window)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 96 |
| 95 static History _createSafe(h) { | 97 static History _createSafe(h) { |
| 96 if (identical(h, window.history)) { | 98 if (identical(h, window.history)) { |
| 97 return h; | 99 return h; |
| 98 } else { | 100 } else { |
| 99 // TODO(vsm): Cache or implement equality. | 101 // TODO(vsm): Cache or implement equality. |
| 100 return new _HistoryCrossFrame(h); | 102 return new _HistoryCrossFrame(h); |
| 101 } | 103 } |
| 102 } | 104 } |
| 103 } | 105 } |
| OLD | NEW |