OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library sharing_mojom; | 5 library sharing_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
14 class _SharingServiceShareTextParams extends bindings.Struct { | 16 class _SharingServiceShareTextParams extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(16, 0) | 18 const bindings.StructDataHeader(16, 0) |
17 ]; | 19 ]; |
18 String text = null; | 20 String text = null; |
19 | 21 |
20 _SharingServiceShareTextParams() : super(kVersions.last.size); | 22 _SharingServiceShareTextParams() : super(kVersions.last.size); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 "text: $text" ")"; | 72 "text: $text" ")"; |
71 } | 73 } |
72 | 74 |
73 Map toJson() { | 75 Map toJson() { |
74 Map map = new Map(); | 76 Map map = new Map(); |
75 map["text"] = text; | 77 map["text"] = text; |
76 return map; | 78 return map; |
77 } | 79 } |
78 } | 80 } |
79 | 81 |
| 82 |
| 83 |
| 84 |
80 const int _SharingService_shareTextName = 0; | 85 const int _SharingService_shareTextName = 0; |
81 | 86 |
| 87 |
| 88 |
| 89 class _SharingServiceServiceDescription implements service_describer.ServiceDesc
ription { |
| 90 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 91 |
| 92 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 93 |
| 94 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 95 } |
| 96 |
82 abstract class SharingService { | 97 abstract class SharingService { |
83 static const String serviceName = "mojo::SharingService"; | 98 static const String serviceName = "mojo::SharingService"; |
84 void shareText(String text); | 99 void shareText(String text); |
85 } | 100 } |
86 | 101 |
87 | 102 |
88 class _SharingServiceProxyImpl extends bindings.Proxy { | 103 class _SharingServiceProxyImpl extends bindings.Proxy { |
89 _SharingServiceProxyImpl.fromEndpoint( | 104 _SharingServiceProxyImpl.fromEndpoint( |
90 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 105 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
91 | 106 |
92 _SharingServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 107 _SharingServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
93 super.fromHandle(handle); | 108 super.fromHandle(handle); |
94 | 109 |
95 _SharingServiceProxyImpl.unbound() : super.unbound(); | 110 _SharingServiceProxyImpl.unbound() : super.unbound(); |
96 | 111 |
97 static _SharingServiceProxyImpl newFromEndpoint( | 112 static _SharingServiceProxyImpl newFromEndpoint( |
98 core.MojoMessagePipeEndpoint endpoint) { | 113 core.MojoMessagePipeEndpoint endpoint) { |
99 assert(endpoint.setDescription("For _SharingServiceProxyImpl")); | 114 assert(endpoint.setDescription("For _SharingServiceProxyImpl")); |
100 return new _SharingServiceProxyImpl.fromEndpoint(endpoint); | 115 return new _SharingServiceProxyImpl.fromEndpoint(endpoint); |
101 } | 116 } |
102 | 117 |
| 118 service_describer.ServiceDescription get serviceDescription => |
| 119 new _SharingServiceServiceDescription(); |
| 120 |
103 void handleResponse(bindings.ServiceMessage message) { | 121 void handleResponse(bindings.ServiceMessage message) { |
104 switch (message.header.type) { | 122 switch (message.header.type) { |
105 default: | 123 default: |
106 proxyError("Unexpected message type: ${message.header.type}"); | 124 proxyError("Unexpected message type: ${message.header.type}"); |
107 close(immediate: true); | 125 close(immediate: true); |
108 break; | 126 break; |
109 } | 127 } |
110 } | 128 } |
111 | 129 |
112 String toString() { | 130 String toString() { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 assert(_impl == null); | 254 assert(_impl == null); |
237 _impl = d; | 255 _impl = d; |
238 } | 256 } |
239 | 257 |
240 String toString() { | 258 String toString() { |
241 var superString = super.toString(); | 259 var superString = super.toString(); |
242 return "SharingServiceStub($superString)"; | 260 return "SharingServiceStub($superString)"; |
243 } | 261 } |
244 | 262 |
245 int get version => 0; | 263 int get version => 0; |
| 264 |
| 265 service_describer.ServiceDescription get serviceDescription => |
| 266 new _SharingServiceServiceDescription(); |
246 } | 267 } |
247 | 268 |
248 | 269 |
| 270 |
OLD | NEW |