| 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 input_mojom; | 5 library input_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 _InputClientOnBackButtonParams extends bindings.Struct { | 16 class _InputClientOnBackButtonParams extends bindings.Struct { |
| 15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
| 16 const bindings.StructDataHeader(8, 0) | 18 const bindings.StructDataHeader(8, 0) |
| 17 ]; | 19 ]; |
| 18 | 20 |
| 19 _InputClientOnBackButtonParams() : super(kVersions.last.size); | 21 _InputClientOnBackButtonParams() : super(kVersions.last.size); |
| 20 | 22 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return "_InputClientOnBackButtonParams("")"; | 64 return "_InputClientOnBackButtonParams("")"; |
| 63 } | 65 } |
| 64 | 66 |
| 65 Map toJson() { | 67 Map toJson() { |
| 66 Map map = new Map(); | 68 Map map = new Map(); |
| 67 return map; | 69 return map; |
| 68 } | 70 } |
| 69 } | 71 } |
| 70 | 72 |
| 71 | 73 |
| 74 |
| 75 |
| 72 class InputClientOnBackButtonResponseParams extends bindings.Struct { | 76 class InputClientOnBackButtonResponseParams extends bindings.Struct { |
| 73 static const List<bindings.StructDataHeader> kVersions = const [ | 77 static const List<bindings.StructDataHeader> kVersions = const [ |
| 74 const bindings.StructDataHeader(8, 0) | 78 const bindings.StructDataHeader(8, 0) |
| 75 ]; | 79 ]; |
| 76 | 80 |
| 77 InputClientOnBackButtonResponseParams() : super(kVersions.last.size); | 81 InputClientOnBackButtonResponseParams() : super(kVersions.last.size); |
| 78 | 82 |
| 79 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess
age) { | 83 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess
age) { |
| 80 var decoder = new bindings.Decoder(message); | 84 var decoder = new bindings.Decoder(message); |
| 81 var result = decode(decoder); | 85 var result = decode(decoder); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return "InputClientOnBackButtonResponseParams("")"; | 124 return "InputClientOnBackButtonResponseParams("")"; |
| 121 } | 125 } |
| 122 | 126 |
| 123 Map toJson() { | 127 Map toJson() { |
| 124 Map map = new Map(); | 128 Map map = new Map(); |
| 125 return map; | 129 return map; |
| 126 } | 130 } |
| 127 } | 131 } |
| 128 | 132 |
| 129 | 133 |
| 134 |
| 135 |
| 130 class _InputServiceSetClientParams extends bindings.Struct { | 136 class _InputServiceSetClientParams extends bindings.Struct { |
| 131 static const List<bindings.StructDataHeader> kVersions = const [ | 137 static const List<bindings.StructDataHeader> kVersions = const [ |
| 132 const bindings.StructDataHeader(16, 0) | 138 const bindings.StructDataHeader(16, 0) |
| 133 ]; | 139 ]; |
| 134 Object client = null; | 140 Object client = null; |
| 135 | 141 |
| 136 _InputServiceSetClientParams() : super(kVersions.last.size); | 142 _InputServiceSetClientParams() : super(kVersions.last.size); |
| 137 | 143 |
| 138 static _InputServiceSetClientParams deserialize(bindings.Message message) { | 144 static _InputServiceSetClientParams deserialize(bindings.Message message) { |
| 139 var decoder = new bindings.Decoder(message); | 145 var decoder = new bindings.Decoder(message); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return "_InputServiceSetClientParams(" | 191 return "_InputServiceSetClientParams(" |
| 186 "client: $client" ")"; | 192 "client: $client" ")"; |
| 187 } | 193 } |
| 188 | 194 |
| 189 Map toJson() { | 195 Map toJson() { |
| 190 throw new bindings.MojoCodecError( | 196 throw new bindings.MojoCodecError( |
| 191 'Object containing handles cannot be encoded to JSON.'); | 197 'Object containing handles cannot be encoded to JSON.'); |
| 192 } | 198 } |
| 193 } | 199 } |
| 194 | 200 |
| 201 |
| 202 |
| 203 |
| 195 const int _InputClient_onBackButtonName = 0; | 204 const int _InputClient_onBackButtonName = 0; |
| 196 | 205 |
| 206 |
| 207 |
| 208 class _InputClientServiceDescription implements service_describer.ServiceDescrip
tion { |
| 209 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 210 |
| 211 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 212 null; |
| 213 |
| 214 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 215 } |
| 216 |
| 197 abstract class InputClient { | 217 abstract class InputClient { |
| 198 static const String serviceName = null; | 218 static const String serviceName = null; |
| 199 dynamic onBackButton([Function responseFactory = null]); | 219 dynamic onBackButton([Function responseFactory = null]); |
| 200 } | 220 } |
| 201 | 221 |
| 202 | 222 |
| 203 class _InputClientProxyImpl extends bindings.Proxy { | 223 class _InputClientProxyImpl extends bindings.Proxy { |
| 204 _InputClientProxyImpl.fromEndpoint( | 224 _InputClientProxyImpl.fromEndpoint( |
| 205 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 225 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 206 | 226 |
| 207 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) : | 227 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) : |
| 208 super.fromHandle(handle); | 228 super.fromHandle(handle); |
| 209 | 229 |
| 210 _InputClientProxyImpl.unbound() : super.unbound(); | 230 _InputClientProxyImpl.unbound() : super.unbound(); |
| 211 | 231 |
| 212 static _InputClientProxyImpl newFromEndpoint( | 232 static _InputClientProxyImpl newFromEndpoint( |
| 213 core.MojoMessagePipeEndpoint endpoint) { | 233 core.MojoMessagePipeEndpoint endpoint) { |
| 214 assert(endpoint.setDescription("For _InputClientProxyImpl")); | 234 assert(endpoint.setDescription("For _InputClientProxyImpl")); |
| 215 return new _InputClientProxyImpl.fromEndpoint(endpoint); | 235 return new _InputClientProxyImpl.fromEndpoint(endpoint); |
| 216 } | 236 } |
| 217 | 237 |
| 238 service_describer.ServiceDescription get serviceDescription => |
| 239 new _InputClientServiceDescription(); |
| 240 |
| 218 void handleResponse(bindings.ServiceMessage message) { | 241 void handleResponse(bindings.ServiceMessage message) { |
| 219 switch (message.header.type) { | 242 switch (message.header.type) { |
| 220 case _InputClient_onBackButtonName: | 243 case _InputClient_onBackButtonName: |
| 221 var r = InputClientOnBackButtonResponseParams.deserialize( | 244 var r = InputClientOnBackButtonResponseParams.deserialize( |
| 222 message.payload); | 245 message.payload); |
| 223 if (!message.header.hasRequestId) { | 246 if (!message.header.hasRequestId) { |
| 224 proxyError("Expected a message with a valid request Id."); | 247 proxyError("Expected a message with a valid request Id."); |
| 225 return; | 248 return; |
| 226 } | 249 } |
| 227 Completer c = completerMap[message.header.requestId]; | 250 Completer c = completerMap[message.header.requestId]; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 assert(_impl == null); | 414 assert(_impl == null); |
| 392 _impl = d; | 415 _impl = d; |
| 393 } | 416 } |
| 394 | 417 |
| 395 String toString() { | 418 String toString() { |
| 396 var superString = super.toString(); | 419 var superString = super.toString(); |
| 397 return "InputClientStub($superString)"; | 420 return "InputClientStub($superString)"; |
| 398 } | 421 } |
| 399 | 422 |
| 400 int get version => 0; | 423 int get version => 0; |
| 424 |
| 425 service_describer.ServiceDescription get serviceDescription => |
| 426 new _InputClientServiceDescription(); |
| 401 } | 427 } |
| 402 | 428 |
| 403 const int _InputService_setClientName = 0; | 429 const int _InputService_setClientName = 0; |
| 404 | 430 |
| 431 |
| 432 |
| 433 class _InputServiceServiceDescription implements service_describer.ServiceDescri
ption { |
| 434 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 435 |
| 436 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 437 null; |
| 438 |
| 439 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 440 } |
| 441 |
| 405 abstract class InputService { | 442 abstract class InputService { |
| 406 static const String serviceName = "input::InputService"; | 443 static const String serviceName = "input::InputService"; |
| 407 void setClient(Object client); | 444 void setClient(Object client); |
| 408 } | 445 } |
| 409 | 446 |
| 410 | 447 |
| 411 class _InputServiceProxyImpl extends bindings.Proxy { | 448 class _InputServiceProxyImpl extends bindings.Proxy { |
| 412 _InputServiceProxyImpl.fromEndpoint( | 449 _InputServiceProxyImpl.fromEndpoint( |
| 413 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 450 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 414 | 451 |
| 415 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 452 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
| 416 super.fromHandle(handle); | 453 super.fromHandle(handle); |
| 417 | 454 |
| 418 _InputServiceProxyImpl.unbound() : super.unbound(); | 455 _InputServiceProxyImpl.unbound() : super.unbound(); |
| 419 | 456 |
| 420 static _InputServiceProxyImpl newFromEndpoint( | 457 static _InputServiceProxyImpl newFromEndpoint( |
| 421 core.MojoMessagePipeEndpoint endpoint) { | 458 core.MojoMessagePipeEndpoint endpoint) { |
| 422 assert(endpoint.setDescription("For _InputServiceProxyImpl")); | 459 assert(endpoint.setDescription("For _InputServiceProxyImpl")); |
| 423 return new _InputServiceProxyImpl.fromEndpoint(endpoint); | 460 return new _InputServiceProxyImpl.fromEndpoint(endpoint); |
| 424 } | 461 } |
| 425 | 462 |
| 463 service_describer.ServiceDescription get serviceDescription => |
| 464 new _InputServiceServiceDescription(); |
| 465 |
| 426 void handleResponse(bindings.ServiceMessage message) { | 466 void handleResponse(bindings.ServiceMessage message) { |
| 427 switch (message.header.type) { | 467 switch (message.header.type) { |
| 428 default: | 468 default: |
| 429 proxyError("Unexpected message type: ${message.header.type}"); | 469 proxyError("Unexpected message type: ${message.header.type}"); |
| 430 close(immediate: true); | 470 close(immediate: true); |
| 431 break; | 471 break; |
| 432 } | 472 } |
| 433 } | 473 } |
| 434 | 474 |
| 435 String toString() { | 475 String toString() { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 assert(_impl == null); | 599 assert(_impl == null); |
| 560 _impl = d; | 600 _impl = d; |
| 561 } | 601 } |
| 562 | 602 |
| 563 String toString() { | 603 String toString() { |
| 564 var superString = super.toString(); | 604 var superString = super.toString(); |
| 565 return "InputServiceStub($superString)"; | 605 return "InputServiceStub($superString)"; |
| 566 } | 606 } |
| 567 | 607 |
| 568 int get version => 0; | 608 int get version => 0; |
| 609 |
| 610 service_describer.ServiceDescription get serviceDescription => |
| 611 new _InputServiceServiceDescription(); |
| 569 } | 612 } |
| 570 | 613 |
| 571 | 614 |
| 615 |
| 616 |
| OLD | NEW |