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 authentication_mojom; | 5 library authentication_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 _AuthenticationServiceSelectAccountParams extends bindings.Struct { | 16 class _AuthenticationServiceSelectAccountParams 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 bool returnLastSelected = false; | 20 bool returnLastSelected = false; |
19 | 21 |
20 _AuthenticationServiceSelectAccountParams() : super(kVersions.last.size); | 22 _AuthenticationServiceSelectAccountParams() : super(kVersions.last.size); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 73 } |
72 | 74 |
73 Map toJson() { | 75 Map toJson() { |
74 Map map = new Map(); | 76 Map map = new Map(); |
75 map["returnLastSelected"] = returnLastSelected; | 77 map["returnLastSelected"] = returnLastSelected; |
76 return map; | 78 return map; |
77 } | 79 } |
78 } | 80 } |
79 | 81 |
80 | 82 |
| 83 |
| 84 |
81 class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct { | 85 class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct { |
82 static const List<bindings.StructDataHeader> kVersions = const [ | 86 static const List<bindings.StructDataHeader> kVersions = const [ |
83 const bindings.StructDataHeader(24, 0) | 87 const bindings.StructDataHeader(24, 0) |
84 ]; | 88 ]; |
85 String username = null; | 89 String username = null; |
86 String error = null; | 90 String error = null; |
87 | 91 |
88 AuthenticationServiceSelectAccountResponseParams() : super(kVersions.last.size
); | 92 AuthenticationServiceSelectAccountResponseParams() : super(kVersions.last.size
); |
89 | 93 |
90 static AuthenticationServiceSelectAccountResponseParams deserialize(bindings.M
essage message) { | 94 static AuthenticationServiceSelectAccountResponseParams deserialize(bindings.M
essage message) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 151 |
148 Map toJson() { | 152 Map toJson() { |
149 Map map = new Map(); | 153 Map map = new Map(); |
150 map["username"] = username; | 154 map["username"] = username; |
151 map["error"] = error; | 155 map["error"] = error; |
152 return map; | 156 return map; |
153 } | 157 } |
154 } | 158 } |
155 | 159 |
156 | 160 |
| 161 |
| 162 |
157 class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct { | 163 class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct { |
158 static const List<bindings.StructDataHeader> kVersions = const [ | 164 static const List<bindings.StructDataHeader> kVersions = const [ |
159 const bindings.StructDataHeader(24, 0) | 165 const bindings.StructDataHeader(24, 0) |
160 ]; | 166 ]; |
161 String username = null; | 167 String username = null; |
162 List<String> scopes = null; | 168 List<String> scopes = null; |
163 | 169 |
164 _AuthenticationServiceGetOAuth2TokenParams() : super(kVersions.last.size); | 170 _AuthenticationServiceGetOAuth2TokenParams() : super(kVersions.last.size); |
165 | 171 |
166 static _AuthenticationServiceGetOAuth2TokenParams deserialize(bindings.Message
message) { | 172 static _AuthenticationServiceGetOAuth2TokenParams deserialize(bindings.Message
message) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 245 |
240 Map toJson() { | 246 Map toJson() { |
241 Map map = new Map(); | 247 Map map = new Map(); |
242 map["username"] = username; | 248 map["username"] = username; |
243 map["scopes"] = scopes; | 249 map["scopes"] = scopes; |
244 return map; | 250 return map; |
245 } | 251 } |
246 } | 252 } |
247 | 253 |
248 | 254 |
| 255 |
| 256 |
249 class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
{ | 257 class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
{ |
250 static const List<bindings.StructDataHeader> kVersions = const [ | 258 static const List<bindings.StructDataHeader> kVersions = const [ |
251 const bindings.StructDataHeader(24, 0) | 259 const bindings.StructDataHeader(24, 0) |
252 ]; | 260 ]; |
253 String token = null; | 261 String token = null; |
254 String error = null; | 262 String error = null; |
255 | 263 |
256 AuthenticationServiceGetOAuth2TokenResponseParams() : super(kVersions.last.siz
e); | 264 AuthenticationServiceGetOAuth2TokenResponseParams() : super(kVersions.last.siz
e); |
257 | 265 |
258 static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(bindings.
Message message) { | 266 static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(bindings.
Message message) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 323 |
316 Map toJson() { | 324 Map toJson() { |
317 Map map = new Map(); | 325 Map map = new Map(); |
318 map["token"] = token; | 326 map["token"] = token; |
319 map["error"] = error; | 327 map["error"] = error; |
320 return map; | 328 return map; |
321 } | 329 } |
322 } | 330 } |
323 | 331 |
324 | 332 |
| 333 |
| 334 |
325 class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct { | 335 class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct { |
326 static const List<bindings.StructDataHeader> kVersions = const [ | 336 static const List<bindings.StructDataHeader> kVersions = const [ |
327 const bindings.StructDataHeader(16, 0) | 337 const bindings.StructDataHeader(16, 0) |
328 ]; | 338 ]; |
329 String token = null; | 339 String token = null; |
330 | 340 |
331 _AuthenticationServiceClearOAuth2TokenParams() : super(kVersions.last.size); | 341 _AuthenticationServiceClearOAuth2TokenParams() : super(kVersions.last.size); |
332 | 342 |
333 static _AuthenticationServiceClearOAuth2TokenParams deserialize(bindings.Messa
ge message) { | 343 static _AuthenticationServiceClearOAuth2TokenParams deserialize(bindings.Messa
ge message) { |
334 var decoder = new bindings.Decoder(message); | 344 var decoder = new bindings.Decoder(message); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 "token: $token" ")"; | 391 "token: $token" ")"; |
382 } | 392 } |
383 | 393 |
384 Map toJson() { | 394 Map toJson() { |
385 Map map = new Map(); | 395 Map map = new Map(); |
386 map["token"] = token; | 396 map["token"] = token; |
387 return map; | 397 return map; |
388 } | 398 } |
389 } | 399 } |
390 | 400 |
| 401 |
| 402 |
| 403 |
391 const int _AuthenticationService_selectAccountName = 0; | 404 const int _AuthenticationService_selectAccountName = 0; |
392 const int _AuthenticationService_getOAuth2TokenName = 1; | 405 const int _AuthenticationService_getOAuth2TokenName = 1; |
393 const int _AuthenticationService_clearOAuth2TokenName = 2; | 406 const int _AuthenticationService_clearOAuth2TokenName = 2; |
394 | 407 |
| 408 |
| 409 |
| 410 class _AuthenticationServiceServiceDescription implements service_describer.Serv
iceDescription { |
| 411 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 412 |
| 413 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 414 null; |
| 415 |
| 416 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 417 } |
| 418 |
395 abstract class AuthenticationService { | 419 abstract class AuthenticationService { |
396 static const String serviceName = "authentication::AuthenticationService"; | 420 static const String serviceName = "authentication::AuthenticationService"; |
397 dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null
]); | 421 dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null
]); |
398 dynamic getOAuth2Token(String username,List<String> scopes,[Function responseF
actory = null]); | 422 dynamic getOAuth2Token(String username,List<String> scopes,[Function responseF
actory = null]); |
399 void clearOAuth2Token(String token); | 423 void clearOAuth2Token(String token); |
400 } | 424 } |
401 | 425 |
402 | 426 |
403 class _AuthenticationServiceProxyImpl extends bindings.Proxy { | 427 class _AuthenticationServiceProxyImpl extends bindings.Proxy { |
404 _AuthenticationServiceProxyImpl.fromEndpoint( | 428 _AuthenticationServiceProxyImpl.fromEndpoint( |
405 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 429 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
406 | 430 |
407 _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 431 _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
408 super.fromHandle(handle); | 432 super.fromHandle(handle); |
409 | 433 |
410 _AuthenticationServiceProxyImpl.unbound() : super.unbound(); | 434 _AuthenticationServiceProxyImpl.unbound() : super.unbound(); |
411 | 435 |
412 static _AuthenticationServiceProxyImpl newFromEndpoint( | 436 static _AuthenticationServiceProxyImpl newFromEndpoint( |
413 core.MojoMessagePipeEndpoint endpoint) { | 437 core.MojoMessagePipeEndpoint endpoint) { |
414 assert(endpoint.setDescription("For _AuthenticationServiceProxyImpl")); | 438 assert(endpoint.setDescription("For _AuthenticationServiceProxyImpl")); |
415 return new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint); | 439 return new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint); |
416 } | 440 } |
417 | 441 |
| 442 service_describer.ServiceDescription get serviceDescription => |
| 443 new _AuthenticationServiceServiceDescription(); |
| 444 |
418 void handleResponse(bindings.ServiceMessage message) { | 445 void handleResponse(bindings.ServiceMessage message) { |
419 switch (message.header.type) { | 446 switch (message.header.type) { |
420 case _AuthenticationService_selectAccountName: | 447 case _AuthenticationService_selectAccountName: |
421 var r = AuthenticationServiceSelectAccountResponseParams.deserialize( | 448 var r = AuthenticationServiceSelectAccountResponseParams.deserialize( |
422 message.payload); | 449 message.payload); |
423 if (!message.header.hasRequestId) { | 450 if (!message.header.hasRequestId) { |
424 proxyError("Expected a message with a valid request Id."); | 451 proxyError("Expected a message with a valid request Id."); |
425 return; | 452 return; |
426 } | 453 } |
427 Completer c = completerMap[message.header.requestId]; | 454 Completer c = completerMap[message.header.requestId]; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 assert(_impl == null); | 693 assert(_impl == null); |
667 _impl = d; | 694 _impl = d; |
668 } | 695 } |
669 | 696 |
670 String toString() { | 697 String toString() { |
671 var superString = super.toString(); | 698 var superString = super.toString(); |
672 return "AuthenticationServiceStub($superString)"; | 699 return "AuthenticationServiceStub($superString)"; |
673 } | 700 } |
674 | 701 |
675 int get version => 0; | 702 int get version => 0; |
| 703 |
| 704 service_describer.ServiceDescription get serviceDescription => |
| 705 new _AuthenticationServiceServiceDescription(); |
676 } | 706 } |
677 | 707 |
678 | 708 |
| 709 |
| 710 |
OLD | NEW |