Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!mojo mojo:dart_content_handler | 1 #!mojo mojo:dart_content_handler |
| 2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 | 7 |
| 8 import 'package:mojo/application.dart'; | 8 import 'package:mojo/application.dart'; |
| 9 import 'package:mojo/bindings.dart'; | 9 import 'package:mojo/bindings.dart'; |
| 10 import 'package:mojo/core.dart'; | 10 import 'package:mojo/core.dart'; |
| 11 import 'package:mojo_services/mojo/device_info.mojom.dart'; | 11 import 'package:mojo_services/mojo/device_info.mojom.dart'; |
| 12 | 12 |
| 13 class DeviceInfoApp extends Application { | 13 class DeviceInfoApp extends Application { |
| 14 final DeviceInfoProxy _deviceInfo = new DeviceInfoProxy.unbound(); | 14 final DeviceInfoProxy _deviceInfo = new DeviceInfoProxy.unbound(); |
| 15 | |
|
alhaad1
2015/10/02 06:33:27
Stray change?
gautham
2015/10/02 22:29:11
Done.
| |
| 16 DeviceInfoApp.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 15 DeviceInfoApp.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
| 17 | |
| 18 Future initialize(List<String> args, String url) async { | 16 Future initialize(List<String> args, String url) async { |
| 19 connectToService("mojo:device_info", _deviceInfo); | 17 connectToService("mojo:device_info", _deviceInfo); |
| 20 print(await _deviceInfo.ptr.getDeviceType()); | 18 print(await _deviceInfo.ptr.getDeviceType()); |
| 21 _deviceInfo.close(); | 19 _deviceInfo.close(); |
| 22 close(); | 20 close(); |
| 23 } | 21 } |
| 24 } | 22 } |
| 25 | 23 |
| 26 main(List args) { | 24 main(List args) { |
| 27 MojoHandle appHandle = new MojoHandle(args[0]); | 25 MojoHandle appHandle = new MojoHandle(args[0]); |
| 28 new DeviceInfoApp.fromHandle(appHandle); | 26 new DeviceInfoApp.fromHandle(appHandle); |
| 29 } | 27 } |
| OLD | NEW |