Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Side by Side Diff: sky/sdk/lib/widgets/widget.dart

Issue 1186813009: Fix the App code to use the new names for AppView. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698