| 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; |
| 210 |
| 211 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 212 |
| 213 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 214 } |
| 215 |
| 197 abstract class InputClient { | 216 abstract class InputClient { |
| 198 static const String serviceName = null; | 217 static const String serviceName = null; |
| 199 dynamic onBackButton([Function responseFactory = null]); | 218 dynamic onBackButton([Function responseFactory = null]); |
| 200 } | 219 } |
| 201 | 220 |
| 202 | 221 |
| 203 class _InputClientProxyImpl extends bindings.Proxy { | 222 class _InputClientProxyImpl extends bindings.Proxy { |
| 204 _InputClientProxyImpl.fromEndpoint( | 223 _InputClientProxyImpl.fromEndpoint( |
| 205 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 224 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 206 | 225 |
| 207 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) : | 226 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) : |
| 208 super.fromHandle(handle); | 227 super.fromHandle(handle); |
| 209 | 228 |
| 210 _InputClientProxyImpl.unbound() : super.unbound(); | 229 _InputClientProxyImpl.unbound() : super.unbound(); |
| 211 | 230 |
| 212 static _InputClientProxyImpl newFromEndpoint( | 231 static _InputClientProxyImpl newFromEndpoint( |
| 213 core.MojoMessagePipeEndpoint endpoint) { | 232 core.MojoMessagePipeEndpoint endpoint) { |
| 214 assert(endpoint.setDescription("For _InputClientProxyImpl")); | 233 assert(endpoint.setDescription("For _InputClientProxyImpl")); |
| 215 return new _InputClientProxyImpl.fromEndpoint(endpoint); | 234 return new _InputClientProxyImpl.fromEndpoint(endpoint); |
| 216 } | 235 } |
| 217 | 236 |
| 237 service_describer.ServiceDescription get serviceDescription => |
| 238 new _InputClientServiceDescription(); |
| 239 |
| 218 void handleResponse(bindings.ServiceMessage message) { | 240 void handleResponse(bindings.ServiceMessage message) { |
| 219 switch (message.header.type) { | 241 switch (message.header.type) { |
| 220 case _InputClient_onBackButtonName: | 242 case _InputClient_onBackButtonName: |
| 221 var r = InputClientOnBackButtonResponseParams.deserialize( | 243 var r = InputClientOnBackButtonResponseParams.deserialize( |
| 222 message.payload); | 244 message.payload); |
| 223 if (!message.header.hasRequestId) { | 245 if (!message.header.hasRequestId) { |
| 224 proxyError("Expected a message with a valid request Id."); | 246 proxyError("Expected a message with a valid request Id."); |
| 225 return; | 247 return; |
| 226 } | 248 } |
| 227 Completer c = completerMap[message.header.requestId]; | 249 Completer c = completerMap[message.header.requestId]; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 assert(_impl == null); | 413 assert(_impl == null); |
| 392 _impl = d; | 414 _impl = d; |
| 393 } | 415 } |
| 394 | 416 |
| 395 String toString() { | 417 String toString() { |
| 396 var superString = super.toString(); | 418 var superString = super.toString(); |
| 397 return "InputClientStub($superString)"; | 419 return "InputClientStub($superString)"; |
| 398 } | 420 } |
| 399 | 421 |
| 400 int get version => 0; | 422 int get version => 0; |
| 423 |
| 424 service_describer.ServiceDescription get serviceDescription => |
| 425 new _InputClientServiceDescription(); |
| 401 } | 426 } |
| 402 | 427 |
| 403 const int _InputService_setClientName = 0; | 428 const int _InputService_setClientName = 0; |
| 404 | 429 |
| 430 |
| 431 |
| 432 class _InputServiceServiceDescription implements service_describer.ServiceDescri
ption { |
| 433 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 434 |
| 435 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 436 |
| 437 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 438 } |
| 439 |
| 405 abstract class InputService { | 440 abstract class InputService { |
| 406 static const String serviceName = "input::InputService"; | 441 static const String serviceName = "input::InputService"; |
| 407 void setClient(Object client); | 442 void setClient(Object client); |
| 408 } | 443 } |
| 409 | 444 |
| 410 | 445 |
| 411 class _InputServiceProxyImpl extends bindings.Proxy { | 446 class _InputServiceProxyImpl extends bindings.Proxy { |
| 412 _InputServiceProxyImpl.fromEndpoint( | 447 _InputServiceProxyImpl.fromEndpoint( |
| 413 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 448 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 414 | 449 |
| 415 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 450 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
| 416 super.fromHandle(handle); | 451 super.fromHandle(handle); |
| 417 | 452 |
| 418 _InputServiceProxyImpl.unbound() : super.unbound(); | 453 _InputServiceProxyImpl.unbound() : super.unbound(); |
| 419 | 454 |
| 420 static _InputServiceProxyImpl newFromEndpoint( | 455 static _InputServiceProxyImpl newFromEndpoint( |
| 421 core.MojoMessagePipeEndpoint endpoint) { | 456 core.MojoMessagePipeEndpoint endpoint) { |
| 422 assert(endpoint.setDescription("For _InputServiceProxyImpl")); | 457 assert(endpoint.setDescription("For _InputServiceProxyImpl")); |
| 423 return new _InputServiceProxyImpl.fromEndpoint(endpoint); | 458 return new _InputServiceProxyImpl.fromEndpoint(endpoint); |
| 424 } | 459 } |
| 425 | 460 |
| 461 service_describer.ServiceDescription get serviceDescription => |
| 462 new _InputServiceServiceDescription(); |
| 463 |
| 426 void handleResponse(bindings.ServiceMessage message) { | 464 void handleResponse(bindings.ServiceMessage message) { |
| 427 switch (message.header.type) { | 465 switch (message.header.type) { |
| 428 default: | 466 default: |
| 429 proxyError("Unexpected message type: ${message.header.type}"); | 467 proxyError("Unexpected message type: ${message.header.type}"); |
| 430 close(immediate: true); | 468 close(immediate: true); |
| 431 break; | 469 break; |
| 432 } | 470 } |
| 433 } | 471 } |
| 434 | 472 |
| 435 String toString() { | 473 String toString() { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 assert(_impl == null); | 597 assert(_impl == null); |
| 560 _impl = d; | 598 _impl = d; |
| 561 } | 599 } |
| 562 | 600 |
| 563 String toString() { | 601 String toString() { |
| 564 var superString = super.toString(); | 602 var superString = super.toString(); |
| 565 return "InputServiceStub($superString)"; | 603 return "InputServiceStub($superString)"; |
| 566 } | 604 } |
| 567 | 605 |
| 568 int get version => 0; | 606 int get version => 0; |
| 607 |
| 608 service_describer.ServiceDescription get serviceDescription => |
| 609 new _InputServiceServiceDescription(); |
| 569 } | 610 } |
| 570 | 611 |
| 571 | 612 |
| 613 |
| OLD | NEW |