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

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

Issue 1214073014: Back button should kill interactive flex app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase and add missing file Created 5 years, 5 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 | « sky/sdk/lib/mojo/activity.dart ('k') | 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 'package:mojom/intents/intents.mojom.dart'; 10 import 'package:sky/mojo/activity.dart' as activity;
abarth-chromium 2015/07/07 19:22:49 We should make these imports consistent.
11 import 'package:sky/mojo/shell.dart' as shell;
12 11
13 import '../base/hit_test.dart'; 12 import '../base/hit_test.dart';
14 import '../rendering/box.dart'; 13 import '../rendering/box.dart';
15 import '../rendering/object.dart'; 14 import '../rendering/object.dart';
16 import '../rendering/sky_binding.dart'; 15 import '../rendering/sky_binding.dart';
17 16
18 export '../rendering/box.dart' show BoxConstraints, BoxDecoration, Border, Borde rSide, EdgeDims; 17 export '../rendering/box.dart' show BoxConstraints, BoxDecoration, Border, Borde rSide, EdgeDims;
19 export '../rendering/flex.dart' show FlexDirection; 18 export '../rendering/flex.dart' show FlexDirection;
20 export '../rendering/object.dart' show Point, Offset, Size, Rect, Color, Paint, Path; 19 export '../rendering/object.dart' show Point, Offset, Size, Rect, Color, Paint, Path;
21 20
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 void didUnmount() { 999 void didUnmount() {
1001 super.didUnmount(); 1000 super.didUnmount();
1002 SkyBinding.instance.removeEventListener(_handleEvent); 1001 SkyBinding.instance.removeEventListener(_handleEvent);
1003 } 1002 }
1004 1003
1005 void syncFields(Component source) { } 1004 void syncFields(Component source) { }
1006 1005
1007 // Override this to handle back button behavior in your app 1006 // Override this to handle back button behavior in your app
1008 // Call super.onBack() to finish the activity 1007 // Call super.onBack() to finish the activity
1009 void onBack() { 1008 void onBack() {
1010 ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound(); 1009 activity.finishCurrentActivity();
1011 shell.requestService('mojo:sky_viewer', activityManager);
1012 activityManager.ptr.finishCurrentActivity();
1013 } 1010 }
1014 } 1011 }
1015 1012
1016 abstract class AbstractWidgetRoot extends StatefulComponent { 1013 abstract class AbstractWidgetRoot extends StatefulComponent {
1017 1014
1018 AbstractWidgetRoot() { 1015 AbstractWidgetRoot() {
1019 _mounted = true; 1016 _mounted = true;
1020 _scheduleComponentForRender(this); 1017 _scheduleComponentForRender(this);
1021 } 1018 }
1022 1019
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 if (root.parent == null) { 1090 if (root.parent == null) {
1094 // we haven't attached it yet 1091 // we haven't attached it yet
1095 assert(_container.child == null); 1092 assert(_container.child == null);
1096 _container.child = root; 1093 _container.child = root;
1097 } 1094 }
1098 assert(root.parent == _container); 1095 assert(root.parent == _container);
1099 } 1096 }
1100 1097
1101 Widget build() => builder(); 1098 Widget build() => builder();
1102 } 1099 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/mojo/activity.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698