| 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
| 9 | 9 |
| 10 import '../base/hit_test.dart'; | 10 import '../base/hit_test.dart'; |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 } | 813 } |
| 814 | 814 |
| 815 abstract class App extends Component { | 815 abstract class App extends Component { |
| 816 void _handleEvent(sky.Event event) { | 816 void _handleEvent(sky.Event event) { |
| 817 if (event.type == 'back') | 817 if (event.type == 'back') |
| 818 onBack(); | 818 onBack(); |
| 819 } | 819 } |
| 820 | 820 |
| 821 void didMount() { | 821 void didMount() { |
| 822 super.didMount(); | 822 super.didMount(); |
| 823 WidgetAppView.appView.addEventListener(_handleEvent); | 823 SkyBinding.instance.addEventListener(_handleEvent); |
| 824 } | 824 } |
| 825 | 825 |
| 826 void didUnmount() { | 826 void didUnmount() { |
| 827 super.didUnmount(); | 827 super.didUnmount(); |
| 828 WidgetAppView.appView.removeEventListener(_handleEvent); | 828 SkyBinding.instance.removeEventListener(_handleEvent); |
| 829 } | 829 } |
| 830 | 830 |
| 831 // Override this to handle back button behavior in your app | 831 // Override this to handle back button behavior in your app |
| 832 void onBack() { } | 832 void onBack() { } |
| 833 } | 833 } |
| 834 | 834 |
| 835 abstract class AbstractWidgetRoot extends Component { | 835 abstract class AbstractWidgetRoot extends Component { |
| 836 | 836 |
| 837 AbstractWidgetRoot() : super(stateful: true) { | 837 AbstractWidgetRoot() : super(stateful: true) { |
| 838 _mounted = true; | 838 _mounted = true; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 if (root.parent == null) { | 907 if (root.parent == null) { |
| 908 // we haven't attached it yet | 908 // we haven't attached it yet |
| 909 assert(_container.child == null); | 909 assert(_container.child == null); |
| 910 _container.child = root; | 910 _container.child = root; |
| 911 } | 911 } |
| 912 assert(root.parent == _container); | 912 assert(root.parent == _container); |
| 913 } | 913 } |
| 914 | 914 |
| 915 Widget build() => builder(); | 915 Widget build() => builder(); |
| 916 } | 916 } |
| OLD | NEW |