| 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 | 14 |
| 13 class Target extends bindings.MojoEnum { | 15 class Target extends bindings.MojoEnum { |
| 14 static const Target default_ = const Target._(0); | 16 static const Target default_ = const Target._(0); |
| 15 static const Target sourceNode = const Target._(1); | 17 static const Target sourceNode = const Target._(1); |
| 16 static const Target newNode = const Target._(2); | 18 static const Target newNode = const Target._(2); |
| 17 | 19 |
| 18 const Target._(int v) : super(v); | 20 const Target._(int v) : super(v); |
| 19 | 21 |
| 20 static const Map<String, Target> valuesMap = const { | 22 static const Map<String, Target> valuesMap = const { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 56 } |
| 55 | 57 |
| 56 String toString() { | 58 String toString() { |
| 57 switch(this) { | 59 switch(this) { |
| 58 case default_: | 60 case default_: |
| 59 return 'Target.default_'; | 61 return 'Target.default_'; |
| 60 case sourceNode: | 62 case sourceNode: |
| 61 return 'Target.sourceNode'; | 63 return 'Target.sourceNode'; |
| 62 case newNode: | 64 case newNode: |
| 63 return 'Target.newNode'; | 65 return 'Target.newNode'; |
| 66 default: |
| 67 return null; |
| 64 } | 68 } |
| 65 } | 69 } |
| 66 | 70 |
| 67 int toJson() => mojoEnumValue; | 71 int toJson() => mojoEnumValue; |
| 68 } | 72 } |
| 69 | 73 |
| 70 | 74 |
| 71 | 75 |
| 76 |
| 77 |
| 72 class _NavigatorHostRequestNavigateParams extends bindings.Struct { | 78 class _NavigatorHostRequestNavigateParams extends bindings.Struct { |
| 73 static const List<bindings.StructDataHeader> kVersions = const [ | 79 static const List<bindings.StructDataHeader> kVersions = const [ |
| 74 const bindings.StructDataHeader(24, 0) | 80 const bindings.StructDataHeader(24, 0) |
| 75 ]; | 81 ]; |
| 76 Target target = null; | 82 Target target = null; |
| 77 url_request_mojom.UrlRequest request = null; | 83 url_request_mojom.UrlRequest request = null; |
| 78 | 84 |
| 79 _NavigatorHostRequestNavigateParams() : super(kVersions.last.size); | 85 _NavigatorHostRequestNavigateParams() : super(kVersions.last.size); |
| 80 | 86 |
| 81 static _NavigatorHostRequestNavigateParams deserialize(bindings.Message messag
e) { | 87 static _NavigatorHostRequestNavigateParams deserialize(bindings.Message messag
e) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 "request: $request" ")"; | 147 "request: $request" ")"; |
| 142 } | 148 } |
| 143 | 149 |
| 144 Map toJson() { | 150 Map toJson() { |
| 145 throw new bindings.MojoCodecError( | 151 throw new bindings.MojoCodecError( |
| 146 'Object containing handles cannot be encoded to JSON.'); | 152 'Object containing handles cannot be encoded to JSON.'); |
| 147 } | 153 } |
| 148 } | 154 } |
| 149 | 155 |
| 150 | 156 |
| 157 |
| 158 |
| 151 class _NavigatorHostRequestNavigateHistoryParams extends bindings.Struct { | 159 class _NavigatorHostRequestNavigateHistoryParams extends bindings.Struct { |
| 152 static const List<bindings.StructDataHeader> kVersions = const [ | 160 static const List<bindings.StructDataHeader> kVersions = const [ |
| 153 const bindings.StructDataHeader(16, 0) | 161 const bindings.StructDataHeader(16, 0) |
| 154 ]; | 162 ]; |
| 155 int delta = 0; | 163 int delta = 0; |
| 156 | 164 |
| 157 _NavigatorHostRequestNavigateHistoryParams() : super(kVersions.last.size); | 165 _NavigatorHostRequestNavigateHistoryParams() : super(kVersions.last.size); |
| 158 | 166 |
| 159 static _NavigatorHostRequestNavigateHistoryParams deserialize(bindings.Message
message) { | 167 static _NavigatorHostRequestNavigateHistoryParams deserialize(bindings.Message
message) { |
| 160 var decoder = new bindings.Decoder(message); | 168 var decoder = new bindings.Decoder(message); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 216 } |
| 209 | 217 |
| 210 Map toJson() { | 218 Map toJson() { |
| 211 Map map = new Map(); | 219 Map map = new Map(); |
| 212 map["delta"] = delta; | 220 map["delta"] = delta; |
| 213 return map; | 221 return map; |
| 214 } | 222 } |
| 215 } | 223 } |
| 216 | 224 |
| 217 | 225 |
| 226 |
| 227 |
| 218 class _NavigatorHostDidNavigateLocallyParams extends bindings.Struct { | 228 class _NavigatorHostDidNavigateLocallyParams extends bindings.Struct { |
| 219 static const List<bindings.StructDataHeader> kVersions = const [ | 229 static const List<bindings.StructDataHeader> kVersions = const [ |
| 220 const bindings.StructDataHeader(16, 0) | 230 const bindings.StructDataHeader(16, 0) |
| 221 ]; | 231 ]; |
| 222 String url = null; | 232 String url = null; |
| 223 | 233 |
| 224 _NavigatorHostDidNavigateLocallyParams() : super(kVersions.last.size); | 234 _NavigatorHostDidNavigateLocallyParams() : super(kVersions.last.size); |
| 225 | 235 |
| 226 static _NavigatorHostDidNavigateLocallyParams deserialize(bindings.Message mes
sage) { | 236 static _NavigatorHostDidNavigateLocallyParams deserialize(bindings.Message mes
sage) { |
| 227 var decoder = new bindings.Decoder(message); | 237 var decoder = new bindings.Decoder(message); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 "url: $url" ")"; | 284 "url: $url" ")"; |
| 275 } | 285 } |
| 276 | 286 |
| 277 Map toJson() { | 287 Map toJson() { |
| 278 Map map = new Map(); | 288 Map map = new Map(); |
| 279 map["url"] = url; | 289 map["url"] = url; |
| 280 return map; | 290 return map; |
| 281 } | 291 } |
| 282 } | 292 } |
| 283 | 293 |
| 294 |
| 295 |
| 296 |
| 284 const int _NavigatorHost_requestNavigateName = 0; | 297 const int _NavigatorHost_requestNavigateName = 0; |
| 285 const int _NavigatorHost_requestNavigateHistoryName = 1; | 298 const int _NavigatorHost_requestNavigateHistoryName = 1; |
| 286 const int _NavigatorHost_didNavigateLocallyName = 2; | 299 const int _NavigatorHost_didNavigateLocallyName = 2; |
| 287 | 300 |
| 301 |
| 302 |
| 303 class _NavigatorHostServiceDescription implements service_describer.ServiceDescr
iption { |
| 304 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 305 |
| 306 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 307 |
| 308 dynamic getAllTypeDefinitions([Function responseFactory]) => 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 |
| OLD | NEW |