| 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 navigation_mojom; | 5 library navigation_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/url_request.mojom.dart' as url_request_mojom; | 13 import 'package:mojo/mojo/url_request.mojom.dart' as url_request_mojom; |
| 12 | |
| 13 class Target extends bindings.MojoEnum { | 14 class Target extends bindings.MojoEnum { |
| 14 static const Target default_ = const Target._(0); | 15 static const Target default_ = const Target._(0); |
| 15 static const Target sourceNode = const Target._(1); | 16 static const Target sourceNode = const Target._(1); |
| 16 static const Target newNode = const Target._(2); | 17 static const Target newNode = const Target._(2); |
| 17 | 18 |
| 18 const Target._(int v) : super(v); | 19 const Target._(int v) : super(v); |
| 19 | 20 |
| 20 static const Map<String, Target> valuesMap = const { | 21 static const Map<String, Target> valuesMap = const { |
| 21 "default_": default_, | 22 "default_": default_, |
| 22 "sourceNode": sourceNode, | 23 "sourceNode": sourceNode, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 55 } |
| 55 | 56 |
| 56 String toString() { | 57 String toString() { |
| 57 switch(this) { | 58 switch(this) { |
| 58 case default_: | 59 case default_: |
| 59 return 'Target.default_'; | 60 return 'Target.default_'; |
| 60 case sourceNode: | 61 case sourceNode: |
| 61 return 'Target.sourceNode'; | 62 return 'Target.sourceNode'; |
| 62 case newNode: | 63 case newNode: |
| 63 return 'Target.newNode'; | 64 return 'Target.newNode'; |
| 65 default: |
| 66 return null; |
| 64 } | 67 } |
| 65 } | 68 } |
| 66 | 69 |
| 67 int toJson() => mojoEnumValue; | 70 int toJson() => mojoEnumValue; |
| 68 } | 71 } |
| 69 | 72 |
| 70 | 73 |
| 71 | 74 |
| 75 |
| 76 |
| 72 class _NavigatorHostRequestNavigateParams extends bindings.Struct { | 77 class _NavigatorHostRequestNavigateParams extends bindings.Struct { |
| 73 static const List<bindings.StructDataHeader> kVersions = const [ | 78 static const List<bindings.StructDataHeader> kVersions = const [ |
| 74 const bindings.StructDataHeader(24, 0) | 79 const bindings.StructDataHeader(24, 0) |
| 75 ]; | 80 ]; |
| 76 Target target = null; | 81 Target target = null; |
| 77 url_request_mojom.UrlRequest request = null; | 82 url_request_mojom.UrlRequest request = null; |
| 78 | 83 |
| 79 _NavigatorHostRequestNavigateParams() : super(kVersions.last.size); | 84 _NavigatorHostRequestNavigateParams() : super(kVersions.last.size); |
| 80 | 85 |
| 81 static _NavigatorHostRequestNavigateParams deserialize(bindings.Message messag
e) { | 86 static _NavigatorHostRequestNavigateParams deserialize(bindings.Message messag
e) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 "request: $request" ")"; | 146 "request: $request" ")"; |
| 142 } | 147 } |
| 143 | 148 |
| 144 Map toJson() { | 149 Map toJson() { |
| 145 throw new bindings.MojoCodecError( | 150 throw new bindings.MojoCodecError( |
| 146 'Object containing handles cannot be encoded to JSON.'); | 151 'Object containing handles cannot be encoded to JSON.'); |
| 147 } | 152 } |
| 148 } | 153 } |
| 149 | 154 |
| 150 | 155 |
| 156 |
| 157 |
| 151 class _NavigatorHostRequestNavigateHistoryParams extends bindings.Struct { | 158 class _NavigatorHostRequestNavigateHistoryParams extends bindings.Struct { |
| 152 static const List<bindings.StructDataHeader> kVersions = const [ | 159 static const List<bindings.StructDataHeader> kVersions = const [ |
| 153 const bindings.StructDataHeader(16, 0) | 160 const bindings.StructDataHeader(16, 0) |
| 154 ]; | 161 ]; |
| 155 int delta = 0; | 162 int delta = 0; |
| 156 | 163 |
| 157 _NavigatorHostRequestNavigateHistoryParams() : super(kVersions.last.size); | 164 _NavigatorHostRequestNavigateHistoryParams() : super(kVersions.last.size); |
| 158 | 165 |
| 159 static _NavigatorHostRequestNavigateHistoryParams deserialize(bindings.Message
message) { | 166 static _NavigatorHostRequestNavigateHistoryParams deserialize(bindings.Message
message) { |
| 160 var decoder = new bindings.Decoder(message); | 167 var decoder = new bindings.Decoder(message); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 215 } |
| 209 | 216 |
| 210 Map toJson() { | 217 Map toJson() { |
| 211 Map map = new Map(); | 218 Map map = new Map(); |
| 212 map["delta"] = delta; | 219 map["delta"] = delta; |
| 213 return map; | 220 return map; |
| 214 } | 221 } |
| 215 } | 222 } |
| 216 | 223 |
| 217 | 224 |
| 225 |
| 226 |
| 218 class _NavigatorHostDidNavigateLocallyParams extends bindings.Struct { | 227 class _NavigatorHostDidNavigateLocallyParams extends bindings.Struct { |
| 219 static const List<bindings.StructDataHeader> kVersions = const [ | 228 static const List<bindings.StructDataHeader> kVersions = const [ |
| 220 const bindings.StructDataHeader(16, 0) | 229 const bindings.StructDataHeader(16, 0) |
| 221 ]; | 230 ]; |
| 222 String url = null; | 231 String url = null; |
| 223 | 232 |
| 224 _NavigatorHostDidNavigateLocallyParams() : super(kVersions.last.size); | 233 _NavigatorHostDidNavigateLocallyParams() : super(kVersions.last.size); |
| 225 | 234 |
| 226 static _NavigatorHostDidNavigateLocallyParams deserialize(bindings.Message mes
sage) { | 235 static _NavigatorHostDidNavigateLocallyParams deserialize(bindings.Message mes
sage) { |
| 227 var decoder = new bindings.Decoder(message); | 236 var decoder = new bindings.Decoder(message); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 "url: $url" ")"; | 283 "url: $url" ")"; |
| 275 } | 284 } |
| 276 | 285 |
| 277 Map toJson() { | 286 Map toJson() { |
| 278 Map map = new Map(); | 287 Map map = new Map(); |
| 279 map["url"] = url; | 288 map["url"] = url; |
| 280 return map; | 289 return map; |
| 281 } | 290 } |
| 282 } | 291 } |
| 283 | 292 |
| 293 |
| 294 |
| 295 |
| 284 const int _NavigatorHost_requestNavigateName = 0; | 296 const int _NavigatorHost_requestNavigateName = 0; |
| 285 const int _NavigatorHost_requestNavigateHistoryName = 1; | 297 const int _NavigatorHost_requestNavigateHistoryName = 1; |
| 286 const int _NavigatorHost_didNavigateLocallyName = 2; | 298 const int _NavigatorHost_didNavigateLocallyName = 2; |
| 287 | 299 |
| 300 |
| 301 |
| 302 class _NavigatorHostServiceDescription implements service_describer.ServiceDescr
iption { |
| 303 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 304 |
| 305 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 306 null; |
| 307 |
| 308 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 309 } |
| 310 |
| 288 abstract class NavigatorHost { | 311 abstract class NavigatorHost { |
| 289 static const String serviceName = "mojo::NavigatorHost"; | 312 static const String serviceName = "mojo::NavigatorHost"; |
| 290 void requestNavigate(Target target, url_request_mojom.UrlRequest request); | 313 void requestNavigate(Target target, url_request_mojom.UrlRequest request); |
| 291 void requestNavigateHistory(int delta); | 314 void requestNavigateHistory(int delta); |
| 292 void didNavigateLocally(String url); | 315 void didNavigateLocally(String url); |
| 293 } | 316 } |
| 294 | 317 |
| 295 | 318 |
| 296 class _NavigatorHostProxyImpl extends bindings.Proxy { | 319 class _NavigatorHostProxyImpl extends bindings.Proxy { |
| 297 _NavigatorHostProxyImpl.fromEndpoint( | 320 _NavigatorHostProxyImpl.fromEndpoint( |
| 298 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 321 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 299 | 322 |
| 300 _NavigatorHostProxyImpl.fromHandle(core.MojoHandle handle) : | 323 _NavigatorHostProxyImpl.fromHandle(core.MojoHandle handle) : |
| 301 super.fromHandle(handle); | 324 super.fromHandle(handle); |
| 302 | 325 |
| 303 _NavigatorHostProxyImpl.unbound() : super.unbound(); | 326 _NavigatorHostProxyImpl.unbound() : super.unbound(); |
| 304 | 327 |
| 305 static _NavigatorHostProxyImpl newFromEndpoint( | 328 static _NavigatorHostProxyImpl newFromEndpoint( |
| 306 core.MojoMessagePipeEndpoint endpoint) { | 329 core.MojoMessagePipeEndpoint endpoint) { |
| 307 assert(endpoint.setDescription("For _NavigatorHostProxyImpl")); | 330 assert(endpoint.setDescription("For _NavigatorHostProxyImpl")); |
| 308 return new _NavigatorHostProxyImpl.fromEndpoint(endpoint); | 331 return new _NavigatorHostProxyImpl.fromEndpoint(endpoint); |
| 309 } | 332 } |
| 310 | 333 |
| 334 service_describer.ServiceDescription get serviceDescription => |
| 335 new _NavigatorHostServiceDescription(); |
| 336 |
| 311 void handleResponse(bindings.ServiceMessage message) { | 337 void handleResponse(bindings.ServiceMessage message) { |
| 312 switch (message.header.type) { | 338 switch (message.header.type) { |
| 313 default: | 339 default: |
| 314 proxyError("Unexpected message type: ${message.header.type}"); | 340 proxyError("Unexpected message type: ${message.header.type}"); |
| 315 close(immediate: true); | 341 close(immediate: true); |
| 316 break; | 342 break; |
| 317 } | 343 } |
| 318 } | 344 } |
| 319 | 345 |
| 320 String toString() { | 346 String toString() { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 assert(_impl == null); | 499 assert(_impl == null); |
| 474 _impl = d; | 500 _impl = d; |
| 475 } | 501 } |
| 476 | 502 |
| 477 String toString() { | 503 String toString() { |
| 478 var superString = super.toString(); | 504 var superString = super.toString(); |
| 479 return "NavigatorHostStub($superString)"; | 505 return "NavigatorHostStub($superString)"; |
| 480 } | 506 } |
| 481 | 507 |
| 482 int get version => 0; | 508 int get version => 0; |
| 509 |
| 510 service_describer.ServiceDescription get serviceDescription => |
| 511 new _NavigatorHostServiceDescription(); |
| 483 } | 512 } |
| 484 | 513 |
| 485 | 514 |
| 515 |
| 516 |
| OLD | NEW |