Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: lib/dom/src/native_DOMImplementation.dart

Issue 10442057: Native wrappers should implement dart:html interfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
25 25
26 static bool isMap(obj) => obj is Map; 26 static bool isMap(obj) => obj is Map;
27 27
28 static Map createMap() => {}; 28 static Map createMap() => {};
29 29
30 static makeNotImplementedException(String fileName, int lineNo) { 30 static makeNotImplementedException(String fileName, int lineNo) {
31 return new UnsupportedOperationException('[info: $fileName:$lineNo]'); 31 return new UnsupportedOperationException('[info: $fileName:$lineNo]');
32 } 32 }
33 33
34 static window() native "Utils_window"; 34 static window() native "Utils_window";
35 static SendPort spawnDomIsolateImpl(_DOMWindow window, String entryPoint) nati ve "Utils_spawnDomIsolate"; 35 static SendPort spawnDomIsolateImpl(Window window, String entryPoint) native " Utils_spawnDomIsolate";
36 } 36 }
37 37
38 Utils_print(String message) native "Utils_print"; 38 Utils_print(String message) native "Utils_print";
39 39
40 class _NPObject extends _DOMWrapperBase { 40 class _NPObject extends _DOMWrapperBase {
41 _NPObject(); 41 _NPObject();
42 static _NPObject retrieve(String key) native "NPObject_retrieve"; 42 static _NPObject retrieve(String key) native "NPObject_retrieve";
43 property(String propertyName) native "NPObject_property"; 43 property(String propertyName) native "NPObject_property";
44 invoke(String methodName, [ObjectArray args = null]) native "NPObject_invoke"; 44 invoke(String methodName, [ObjectArray args = null]) native "NPObject_invoke";
45 } 45 }
46 46
47 class _DOMWindowCrossFrameDOMImpl extends _DOMWrapperBase implements _DOMWindow { 47 class _DOMWindowCrossFrameDOMImpl extends _DOMWrapperBase implements Window {
48 _DOMWindowCrossFrameDOMImpl(); 48 _DOMWindowCrossFrameDOMImpl();
49 49
50 // Fields. 50 // Fields.
51 History get history() native "DOMWindow_history_cross_frame_Getter"; 51 History get history() native "DOMWindow_history_cross_frame_Getter";
52 Location get location() native "DOMWindow_location_cross_frame_Getter"; 52 Location get location() native "DOMWindow_location_cross_frame_Getter";
53 bool get closed() native "DOMWindow_closed_Getter"; 53 bool get closed() native "DOMWindow_closed_Getter";
54 int get length() native "DOMWindow_length_Getter"; 54 int get length() native "DOMWindow_length_Getter";
55 DOMWindow get opener() native "DOMWindow_opener_Getter"; 55 DOMWindow get opener() native "DOMWindow_opener_Getter";
56 DOMWindow get parent() native "DOMWindow_parent_Getter"; 56 DOMWindow get parent() native "DOMWindow_parent_Getter";
57 DOMWindow get top() native "DOMWindow_top_Getter"; 57 DOMWindow get top() native "DOMWindow_top_Getter";
58 58
59 // Methods. 59 // Methods.
60 void focus() native "DOMWindow_focus_Callback"; 60 void focus() native "DOMWindow_focus_Callback";
61 void blur() native "DOMWindow_blur_Callback"; 61 void blur() native "DOMWindow_blur_Callback";
62 void close() native "DOMWindow_close_Callback"; 62 void close() native "DOMWindow_close_Callback";
63 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) native "DOMWindow_postMessage_Callback"; 63 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) native "DOMWindow_postMessage_Callback";
64 64
65 // Implementation support. 65 // Implementation support.
66 String get typeName() => "DOMWindow"; 66 String get typeName() => "DOMWindow";
67 } 67 }
68 68
69 class _HistoryCrossFrameDOMImpl extends _DOMWrapperBase implements _History { 69 class _HistoryCrossFrameDOMImpl extends _DOMWrapperBase implements History {
70 _HistoryCrossFrameDOMImpl(); 70 _HistoryCrossFrameDOMImpl();
71 71
72 // Methods. 72 // Methods.
73 void back() native "History_back_Callback"; 73 void back() native "History_back_Callback";
74 void forward() native "History_forward_Callback"; 74 void forward() native "History_forward_Callback";
75 void go(int distance) native "History_go_Callback"; 75 void go(int distance) native "History_go_Callback";
76 76
77 // Implementation support. 77 // Implementation support.
78 String get typeName() => "History"; 78 String get typeName() => "History";
79 } 79 }
80 80
81 class _LocationCrossFrameDOMImpl extends _DOMWrapperBase implements _Location { 81 class _LocationCrossFrameDOMImpl extends _DOMWrapperBase implements Location {
82 _LocationCrossFrameDOMImpl(); 82 _LocationCrossFrameDOMImpl();
83 83
84 // Fields. 84 // Fields.
85 void set href(String) native "Location_href_Setter"; 85 void set href(String) native "Location_href_Setter";
86 86
87 // Implementation support. 87 // Implementation support.
88 String get typeName() => "Location"; 88 String get typeName() => "Location";
89 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698