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 view_associates_mojom; | 5 library view_associates_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 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; | 13 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; |
12 import 'package:mojo_services/mojo/ui/views.mojom.dart' as views_mojom; | 14 import 'package:mojo_services/mojo/ui/views.mojom.dart' as views_mojom; |
13 import 'package:mojo_services/mojo/ui/view_trees.mojom.dart' as view_trees_mojom
; | 15 import 'package:mojo_services/mojo/ui/view_trees.mojom.dart' as view_trees_mojom
; |
14 | 16 |
15 | 17 |
16 | 18 |
17 class ViewAssociateInfo extends bindings.Struct { | 19 class ViewAssociateInfo extends bindings.Struct { |
18 static const List<bindings.StructDataHeader> kVersions = const [ | 20 static const List<bindings.StructDataHeader> kVersions = const [ |
19 const bindings.StructDataHeader(24, 0) | 21 const bindings.StructDataHeader(24, 0) |
20 ]; | 22 ]; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 121 |
120 Map toJson() { | 122 Map toJson() { |
121 Map map = new Map(); | 123 Map map = new Map(); |
122 map["viewServiceNames"] = viewServiceNames; | 124 map["viewServiceNames"] = viewServiceNames; |
123 map["viewTreeServiceNames"] = viewTreeServiceNames; | 125 map["viewTreeServiceNames"] = viewTreeServiceNames; |
124 return map; | 126 return map; |
125 } | 127 } |
126 } | 128 } |
127 | 129 |
128 | 130 |
| 131 |
| 132 |
129 class _ViewAssociateConnectParams extends bindings.Struct { | 133 class _ViewAssociateConnectParams extends bindings.Struct { |
130 static const List<bindings.StructDataHeader> kVersions = const [ | 134 static const List<bindings.StructDataHeader> kVersions = const [ |
131 const bindings.StructDataHeader(16, 0) | 135 const bindings.StructDataHeader(16, 0) |
132 ]; | 136 ]; |
133 Object inspector = null; | 137 Object inspector = null; |
134 | 138 |
135 _ViewAssociateConnectParams() : super(kVersions.last.size); | 139 _ViewAssociateConnectParams() : super(kVersions.last.size); |
136 | 140 |
137 static _ViewAssociateConnectParams deserialize(bindings.Message message) { | 141 static _ViewAssociateConnectParams deserialize(bindings.Message message) { |
138 var decoder = new bindings.Decoder(message); | 142 var decoder = new bindings.Decoder(message); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 "inspector: $inspector" ")"; | 189 "inspector: $inspector" ")"; |
186 } | 190 } |
187 | 191 |
188 Map toJson() { | 192 Map toJson() { |
189 throw new bindings.MojoCodecError( | 193 throw new bindings.MojoCodecError( |
190 'Object containing handles cannot be encoded to JSON.'); | 194 'Object containing handles cannot be encoded to JSON.'); |
191 } | 195 } |
192 } | 196 } |
193 | 197 |
194 | 198 |
| 199 |
| 200 |
195 class ViewAssociateConnectResponseParams extends bindings.Struct { | 201 class ViewAssociateConnectResponseParams extends bindings.Struct { |
196 static const List<bindings.StructDataHeader> kVersions = const [ | 202 static const List<bindings.StructDataHeader> kVersions = const [ |
197 const bindings.StructDataHeader(16, 0) | 203 const bindings.StructDataHeader(16, 0) |
198 ]; | 204 ]; |
199 ViewAssociateInfo info = null; | 205 ViewAssociateInfo info = null; |
200 | 206 |
201 ViewAssociateConnectResponseParams() : super(kVersions.last.size); | 207 ViewAssociateConnectResponseParams() : super(kVersions.last.size); |
202 | 208 |
203 static ViewAssociateConnectResponseParams deserialize(bindings.Message message
) { | 209 static ViewAssociateConnectResponseParams deserialize(bindings.Message message
) { |
204 var decoder = new bindings.Decoder(message); | 210 var decoder = new bindings.Decoder(message); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 259 } |
254 | 260 |
255 Map toJson() { | 261 Map toJson() { |
256 Map map = new Map(); | 262 Map map = new Map(); |
257 map["info"] = info; | 263 map["info"] = info; |
258 return map; | 264 return map; |
259 } | 265 } |
260 } | 266 } |
261 | 267 |
262 | 268 |
| 269 |
| 270 |
263 class _ViewAssociateConnectToViewServiceParams extends bindings.Struct { | 271 class _ViewAssociateConnectToViewServiceParams extends bindings.Struct { |
264 static const List<bindings.StructDataHeader> kVersions = const [ | 272 static const List<bindings.StructDataHeader> kVersions = const [ |
265 const bindings.StructDataHeader(32, 0) | 273 const bindings.StructDataHeader(32, 0) |
266 ]; | 274 ]; |
267 views_mojom.ViewToken viewToken = null; | 275 views_mojom.ViewToken viewToken = null; |
268 String serviceName_ = null; | 276 String serviceName_ = null; |
269 core.MojoMessagePipeEndpoint pipe = null; | 277 core.MojoMessagePipeEndpoint pipe = null; |
270 | 278 |
271 _ViewAssociateConnectToViewServiceParams() : super(kVersions.last.size); | 279 _ViewAssociateConnectToViewServiceParams() : super(kVersions.last.size); |
272 | 280 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 "pipe: $pipe" ")"; | 344 "pipe: $pipe" ")"; |
337 } | 345 } |
338 | 346 |
339 Map toJson() { | 347 Map toJson() { |
340 throw new bindings.MojoCodecError( | 348 throw new bindings.MojoCodecError( |
341 'Object containing handles cannot be encoded to JSON.'); | 349 'Object containing handles cannot be encoded to JSON.'); |
342 } | 350 } |
343 } | 351 } |
344 | 352 |
345 | 353 |
| 354 |
| 355 |
346 class _ViewAssociateConnectToViewTreeServiceParams extends bindings.Struct { | 356 class _ViewAssociateConnectToViewTreeServiceParams extends bindings.Struct { |
347 static const List<bindings.StructDataHeader> kVersions = const [ | 357 static const List<bindings.StructDataHeader> kVersions = const [ |
348 const bindings.StructDataHeader(32, 0) | 358 const bindings.StructDataHeader(32, 0) |
349 ]; | 359 ]; |
350 view_trees_mojom.ViewTreeToken viewTreeToken = null; | 360 view_trees_mojom.ViewTreeToken viewTreeToken = null; |
351 String serviceName_ = null; | 361 String serviceName_ = null; |
352 core.MojoMessagePipeEndpoint pipe = null; | 362 core.MojoMessagePipeEndpoint pipe = null; |
353 | 363 |
354 _ViewAssociateConnectToViewTreeServiceParams() : super(kVersions.last.size); | 364 _ViewAssociateConnectToViewTreeServiceParams() : super(kVersions.last.size); |
355 | 365 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 "serviceName_: $serviceName_" ", " | 428 "serviceName_: $serviceName_" ", " |
419 "pipe: $pipe" ")"; | 429 "pipe: $pipe" ")"; |
420 } | 430 } |
421 | 431 |
422 Map toJson() { | 432 Map toJson() { |
423 throw new bindings.MojoCodecError( | 433 throw new bindings.MojoCodecError( |
424 'Object containing handles cannot be encoded to JSON.'); | 434 'Object containing handles cannot be encoded to JSON.'); |
425 } | 435 } |
426 } | 436 } |
427 | 437 |
| 438 |
| 439 |
| 440 |
428 const int _ViewAssociate_connectName = 0; | 441 const int _ViewAssociate_connectName = 0; |
429 const int _ViewAssociate_connectToViewServiceName = 1; | 442 const int _ViewAssociate_connectToViewServiceName = 1; |
430 const int _ViewAssociate_connectToViewTreeServiceName = 2; | 443 const int _ViewAssociate_connectToViewTreeServiceName = 2; |
431 | 444 |
| 445 |
| 446 |
| 447 class _ViewAssociateServiceDescription implements service_describer.ServiceDescr
iption { |
| 448 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 449 |
| 450 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 451 |
| 452 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 453 } |
| 454 |
432 abstract class ViewAssociate { | 455 abstract class ViewAssociate { |
433 static const String serviceName = "mojo::ui::ViewAssociate"; | 456 static const String serviceName = "mojo::ui::ViewAssociate"; |
434 dynamic connect(Object inspector,[Function responseFactory = null]); | 457 dynamic connect(Object inspector,[Function responseFactory = null]); |
435 void connectToViewService(views_mojom.ViewToken viewToken, String serviceName_
, core.MojoMessagePipeEndpoint pipe); | 458 void connectToViewService(views_mojom.ViewToken viewToken, String serviceName_
, core.MojoMessagePipeEndpoint pipe); |
436 void connectToViewTreeService(view_trees_mojom.ViewTreeToken viewTreeToken, St
ring serviceName_, core.MojoMessagePipeEndpoint pipe); | 459 void connectToViewTreeService(view_trees_mojom.ViewTreeToken viewTreeToken, St
ring serviceName_, core.MojoMessagePipeEndpoint pipe); |
437 } | 460 } |
438 | 461 |
439 | 462 |
440 class _ViewAssociateProxyImpl extends bindings.Proxy { | 463 class _ViewAssociateProxyImpl extends bindings.Proxy { |
441 _ViewAssociateProxyImpl.fromEndpoint( | 464 _ViewAssociateProxyImpl.fromEndpoint( |
442 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 465 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
443 | 466 |
444 _ViewAssociateProxyImpl.fromHandle(core.MojoHandle handle) : | 467 _ViewAssociateProxyImpl.fromHandle(core.MojoHandle handle) : |
445 super.fromHandle(handle); | 468 super.fromHandle(handle); |
446 | 469 |
447 _ViewAssociateProxyImpl.unbound() : super.unbound(); | 470 _ViewAssociateProxyImpl.unbound() : super.unbound(); |
448 | 471 |
449 static _ViewAssociateProxyImpl newFromEndpoint( | 472 static _ViewAssociateProxyImpl newFromEndpoint( |
450 core.MojoMessagePipeEndpoint endpoint) { | 473 core.MojoMessagePipeEndpoint endpoint) { |
451 assert(endpoint.setDescription("For _ViewAssociateProxyImpl")); | 474 assert(endpoint.setDescription("For _ViewAssociateProxyImpl")); |
452 return new _ViewAssociateProxyImpl.fromEndpoint(endpoint); | 475 return new _ViewAssociateProxyImpl.fromEndpoint(endpoint); |
453 } | 476 } |
454 | 477 |
| 478 service_describer.ServiceDescription get serviceDescription => |
| 479 new _ViewAssociateServiceDescription(); |
| 480 |
455 void handleResponse(bindings.ServiceMessage message) { | 481 void handleResponse(bindings.ServiceMessage message) { |
456 switch (message.header.type) { | 482 switch (message.header.type) { |
457 case _ViewAssociate_connectName: | 483 case _ViewAssociate_connectName: |
458 var r = ViewAssociateConnectResponseParams.deserialize( | 484 var r = ViewAssociateConnectResponseParams.deserialize( |
459 message.payload); | 485 message.payload); |
460 if (!message.header.hasRequestId) { | 486 if (!message.header.hasRequestId) { |
461 proxyError("Expected a message with a valid request Id."); | 487 proxyError("Expected a message with a valid request Id."); |
462 return; | 488 return; |
463 } | 489 } |
464 Completer c = completerMap[message.header.requestId]; | 490 Completer c = completerMap[message.header.requestId]; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 assert(_impl == null); | 688 assert(_impl == null); |
663 _impl = d; | 689 _impl = d; |
664 } | 690 } |
665 | 691 |
666 String toString() { | 692 String toString() { |
667 var superString = super.toString(); | 693 var superString = super.toString(); |
668 return "ViewAssociateStub($superString)"; | 694 return "ViewAssociateStub($superString)"; |
669 } | 695 } |
670 | 696 |
671 int get version => 0; | 697 int get version => 0; |
| 698 |
| 699 service_describer.ServiceDescription get serviceDescription => |
| 700 new _ViewAssociateServiceDescription(); |
672 } | 701 } |
673 | 702 |
674 | 703 |
| 704 |
| 705 |
| 706 class _ViewInspectorServiceDescription implements service_describer.ServiceDescr
iption { |
| 707 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 708 |
| 709 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 710 |
| 711 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 712 } |
| 713 |
675 abstract class ViewInspector { | 714 abstract class ViewInspector { |
676 static const String serviceName = null; | 715 static const String serviceName = null; |
677 } | 716 } |
678 | 717 |
679 | 718 |
680 class _ViewInspectorProxyImpl extends bindings.Proxy { | 719 class _ViewInspectorProxyImpl extends bindings.Proxy { |
681 _ViewInspectorProxyImpl.fromEndpoint( | 720 _ViewInspectorProxyImpl.fromEndpoint( |
682 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 721 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
683 | 722 |
684 _ViewInspectorProxyImpl.fromHandle(core.MojoHandle handle) : | 723 _ViewInspectorProxyImpl.fromHandle(core.MojoHandle handle) : |
685 super.fromHandle(handle); | 724 super.fromHandle(handle); |
686 | 725 |
687 _ViewInspectorProxyImpl.unbound() : super.unbound(); | 726 _ViewInspectorProxyImpl.unbound() : super.unbound(); |
688 | 727 |
689 static _ViewInspectorProxyImpl newFromEndpoint( | 728 static _ViewInspectorProxyImpl newFromEndpoint( |
690 core.MojoMessagePipeEndpoint endpoint) { | 729 core.MojoMessagePipeEndpoint endpoint) { |
691 assert(endpoint.setDescription("For _ViewInspectorProxyImpl")); | 730 assert(endpoint.setDescription("For _ViewInspectorProxyImpl")); |
692 return new _ViewInspectorProxyImpl.fromEndpoint(endpoint); | 731 return new _ViewInspectorProxyImpl.fromEndpoint(endpoint); |
693 } | 732 } |
694 | 733 |
| 734 service_describer.ServiceDescription get serviceDescription => |
| 735 new _ViewInspectorServiceDescription(); |
| 736 |
695 void handleResponse(bindings.ServiceMessage message) { | 737 void handleResponse(bindings.ServiceMessage message) { |
696 switch (message.header.type) { | 738 switch (message.header.type) { |
697 default: | 739 default: |
698 proxyError("Unexpected message type: ${message.header.type}"); | 740 proxyError("Unexpected message type: ${message.header.type}"); |
699 close(immediate: true); | 741 close(immediate: true); |
700 break; | 742 break; |
701 } | 743 } |
702 } | 744 } |
703 | 745 |
704 String toString() { | 746 String toString() { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 assert(_impl == null); | 856 assert(_impl == null); |
815 _impl = d; | 857 _impl = d; |
816 } | 858 } |
817 | 859 |
818 String toString() { | 860 String toString() { |
819 var superString = super.toString(); | 861 var superString = super.toString(); |
820 return "ViewInspectorStub($superString)"; | 862 return "ViewInspectorStub($superString)"; |
821 } | 863 } |
822 | 864 |
823 int get version => 0; | 865 int get version => 0; |
| 866 |
| 867 service_describer.ServiceDescription get serviceDescription => |
| 868 new _ViewInspectorServiceDescription(); |
824 } | 869 } |
825 | 870 |
826 | 871 |
| 872 |
OLD | NEW |