Chromium Code Reviews| 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 |
| 11 // properly. Its fields and methods can only be accessed via JavaScript. | 11 // properly. Its fields and methods can only be accessed via JavaScript. |
| 12 var _window; | 12 final var _window; |
|
Andrei Mouravski
2013/03/28 17:22:22
Get rid of "var."
| |
| 13 | 13 |
| 14 // Fields. | 14 // Fields. |
| 15 HistoryBase get history => | 15 HistoryBase get history => |
| 16 _HistoryCrossFrame._createSafe(JS('HistoryBase', '#.history', _window)); | 16 _HistoryCrossFrame._createSafe(JS('HistoryBase', '#.history', _window)); |
| 17 LocationBase get location => | 17 LocationBase get location => |
| 18 _LocationCrossFrame._createSafe(JS('LocationBase', '#.location', _window)); | 18 _LocationCrossFrame._createSafe(JS('LocationBase', '#.location', _window)); |
| 19 | 19 |
| 20 // TODO(vsm): Add frames to navigate subframes. See 2312. | 20 // TODO(vsm): Add frames to navigate subframes. See 2312. |
| 21 | 21 |
| 22 bool get closed => JS('bool', '#.closed', _window); | 22 bool get closed => JS('bool', '#.closed', _window); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 | 92 |
| 93 static HistoryBase _createSafe(h) { | 93 static HistoryBase _createSafe(h) { |
| 94 if (identical(h, window.history)) { | 94 if (identical(h, window.history)) { |
| 95 return h; | 95 return h; |
| 96 } else { | 96 } else { |
| 97 // TODO(vsm): Cache or implement equality. | 97 // TODO(vsm): Cache or implement equality. |
| 98 return new _HistoryCrossFrame(h); | 98 return new _HistoryCrossFrame(h); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 } | 101 } |
| OLD | NEW |