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 class Utils { | 5 class Utils { |
6 static List convertToList(List list) { | 6 static List convertToList(List list) { |
7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. | 7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. |
8 final length = list.length; | 8 final length = list.length; |
9 List result = new List(length); | 9 List result = new List(length); |
10 result.copyFrom(list, 0, 0, length); | 10 result.copyFrom(list, 0, 0, length); |
(...skipping 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 class NPObject extends DOMWrapperBase { | 26 class NPObject extends DOMWrapperBase { |
27 static NPObject retrieve(String key) native "NPObject_retrieve"; | 27 static NPObject retrieve(String key) native "NPObject_retrieve"; |
28 property(String propertyName) native "NPObject_property"; | 28 property(String propertyName) native "NPObject_property"; |
29 invoke(String methodName, [ObjectArray args = null]) native "NPObject_invoke"; | 29 invoke(String methodName, [ObjectArray args = null]) native "NPObject_invoke"; |
30 | 30 |
31 static _createNPObject() => new NPObject._createNPObject(); | 31 static _createNPObject() => new NPObject._createNPObject(); |
32 NPObject._createNPObject(); | 32 NPObject._createNPObject(); |
33 } | 33 } |
34 | 34 |
35 class DOMWindowCrossFrameImplementation extends DOMWrapperBase implements DOMWin
dow { | 35 class WindowCrossFrameImplementation extends DOMWrapperBase implements Window { |
36 // Fields. | 36 // Fields. |
37 History get history() native "DOMWindow_history_cross_frame_Getter"; | 37 History get history() native "Window_history_cross_frame_Getter"; |
38 Location get location() native "DOMWindow_location_cross_frame_Getter"; | 38 Location get location() native "Window_location_cross_frame_Getter"; |
39 bool get closed() native "DOMWindow_closed_Getter"; | 39 bool get closed() native "Window_closed_Getter"; |
40 int get length() native "DOMWindow_length_Getter"; | 40 int get length() native "Window_length_Getter"; |
41 DOMWindow get opener() native "DOMWindow_opener_Getter"; | 41 DOMWindow get opener() native "Window_opener_Getter"; |
42 DOMWindow get parent() native "DOMWindow_parent_Getter"; | 42 DOMWindow get parent() native "Window_parent_Getter"; |
43 DOMWindow get top() native "DOMWindow_top_Getter"; | 43 DOMWindow get top() native "Window_top_Getter"; |
44 | 44 |
45 // Methods. | 45 // Methods. |
46 void focus() native "DOMWindow_focus_Callback"; | 46 void focus() native "Window_focus_Callback"; |
47 void blur() native "DOMWindow_blur_Callback"; | 47 void blur() native "Window_blur_Callback"; |
48 void close() native "DOMWindow_close_Callback"; | 48 void close() native "Window_close_Callback"; |
49 void postMessage([_arg0, _arg1, _arg2]) native "DOMWindow_postMessage_Callback
"; | 49 void postMessage([_arg0, _arg1, _arg2]) native "Window_postMessage_Callback"; |
50 | 50 |
51 // Implementation support. | 51 // Implementation support. |
52 static DOMWindowCrossFrameImplementation _createDOMWindowCrossFrameImplementat
ion() => new DOMWindowCrossFrameImplementation._createDOMWindowCrossFrameImpleme
ntation(); | 52 static WindowCrossFrameImplementation _createWindowCrossFrameImplementation()
=> new WindowCrossFrameImplementation._createWindowCrossFrameImplementation(); |
53 DOMWindowCrossFrameImplementation._createDOMWindowCrossFrameImplementation(); | 53 WindowCrossFrameImplementation._createWindowCrossFrameImplementation(); |
54 | 54 |
55 String get typeName() => "DOMWindow"; | 55 String get typeName() => "Window"; |
56 } | 56 } |
57 | 57 |
58 class HistoryCrossFrameImplementation extends DOMWrapperBase implements History
{ | 58 class HistoryCrossFrameImplementation extends DOMWrapperBase implements History
{ |
59 // Methods. | 59 // Methods. |
60 void back() native "History_back_Callback"; | 60 void back() native "History_back_Callback"; |
61 void forward() native "History_forward_Callback"; | 61 void forward() native "History_forward_Callback"; |
62 void go(int distance) native "History_go_Callback"; | 62 void go(int distance) native "History_go_Callback"; |
63 | 63 |
64 // Implementation support. | 64 // Implementation support. |
65 static HistoryCrossFrameImplementation _createHistoryCrossFrameImplementation(
) => new HistoryCrossFrameImplementation._createHistoryCrossFrameImplementation(
); | 65 static HistoryCrossFrameImplementation _createHistoryCrossFrameImplementation(
) => new HistoryCrossFrameImplementation._createHistoryCrossFrameImplementation(
); |
66 HistoryCrossFrameImplementation._createHistoryCrossFrameImplementation(); | 66 HistoryCrossFrameImplementation._createHistoryCrossFrameImplementation(); |
67 | 67 |
68 String get typeName() => "History"; | 68 String get typeName() => "History"; |
69 } | 69 } |
70 | 70 |
71 class LocationCrossFrameImplementation extends DOMWrapperBase implements Locatio
n { | 71 class LocationCrossFrameImplementation extends DOMWrapperBase implements Locatio
n { |
72 // Fields. | 72 // Fields. |
73 void set href(String) native "Location_href_Setter"; | 73 void set href(String) native "Location_href_Setter"; |
74 | 74 |
75 // Implementation support. | 75 // Implementation support. |
76 static LocationCrossFrameImplementation _createLocationCrossFrameImplementatio
n() => new LocationCrossFrameImplementation._createLocationCrossFrameImplementat
ion(); | 76 static LocationCrossFrameImplementation _createLocationCrossFrameImplementatio
n() => new LocationCrossFrameImplementation._createLocationCrossFrameImplementat
ion(); |
77 LocationCrossFrameImplementation._createLocationCrossFrameImplementation(); | 77 LocationCrossFrameImplementation._createLocationCrossFrameImplementation(); |
78 | 78 |
79 String get typeName() => "Location"; | 79 String get typeName() => "Location"; |
80 } | 80 } |
OLD | NEW |