| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 import "dart:math"; | 5 import "dart:math"; |
| 6 import 'dart:sky'; | 6 import 'dart:sky'; |
| 7 | 7 |
| 8 import 'package:sky/framework/shell.dart' as shell; | 8 import 'package:sky/framework/shell.dart' as shell; |
| 9 import 'package:mojom/intents/intents.mojom.dart'; | 9 import 'package:mojom/intents/intents.mojom.dart'; |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return true; | 28 return true; |
| 29 } | 29 } |
| 30 | 30 |
| 31 if (event.type == "pointerup") { | 31 if (event.type == "pointerup") { |
| 32 view.picture = draw(255, 255, 255, 0); | 32 view.picture = draw(255, 255, 255, 0); |
| 33 view.scheduleFrame(); | 33 view.scheduleFrame(); |
| 34 | 34 |
| 35 ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound(); | 35 ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound(); |
| 36 Intent intent = new Intent() | 36 Intent intent = new Intent() |
| 37 ..action = 'android.intent.action.VIEW' | 37 ..action = 'android.intent.action.VIEW' |
| 38 ..url = 'sky://localhost:9888/sky/examples/raw/hello_world.dart'; | 38 ..url = 'sky://localhost:9888/sky/sdk/lib/example/raw/hello_world.dart'; |
| 39 shell.requestService(null, activityManager); | 39 shell.requestService(null, activityManager); |
| 40 activityManager.ptr.startActivity(intent); | 40 activityManager.ptr.startActivity(intent); |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 | 43 |
| 44 if (event.type == "back") { | 44 if (event.type == "back") { |
| 45 print("Pressed back button."); | 45 print("Pressed back button."); |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void main() { | 52 void main() { |
| 53 print("Hello, world"); | 53 print("Hello, world"); |
| 54 view.picture = draw(255, 255, 255, 0); | 54 view.picture = draw(255, 255, 255, 0); |
| 55 view.scheduleFrame(); | 55 view.scheduleFrame(); |
| 56 | 56 |
| 57 view.setEventCallback(handleEvent); | 57 view.setEventCallback(handleEvent); |
| 58 } | 58 } |
| OLD | NEW |