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

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

Issue 1175423007: Create an example app that demonstrates interactive coordination of an fn tree and a raw RenderObje… (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
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 '../app/view.dart'; 10 import '../app/view.dart';
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 // we haven't attached it yet 809 // we haven't attached it yet
810 UINodeAppView._appView.root = root; 810 UINodeAppView._appView.root = root;
811 } 811 }
812 assert(root.parent is RenderView); 812 assert(root.parent is RenderView);
813 } 813 }
814 814
815 } 815 }
816 816
817 typedef UINode Builder(); 817 typedef UINode Builder();
818 818
819 class RenderObjectToUINodeAdapter extends AbstractUINodeRoot { 819 class RenderBoxToUINodeAdapter extends AbstractUINodeRoot {
820 820
821 RenderObjectToUINodeAdapter( 821 RenderBoxToUINodeAdapter(
822 RenderObjectWithChildMixin<RenderBox> container, 822 RenderObjectWithChildMixin<RenderBox> container,
823 this.builder 823 this.builder
824 ) : _container = container, super() { 824 ) : _container = container, super() {
825 assert(builder != null); 825 assert(builder != null);
826 } 826 }
827 827
828 RenderObjectWithChildMixin<RenderBox> _container; 828 RenderObjectWithChildMixin<RenderBox> _container;
829 RenderObjectWithChildMixin<RenderBox> get container => _container; 829 RenderObjectWithChildMixin<RenderBox> get container => _container;
830 void set container(RenderObjectWithChildMixin<RenderBox> value) { 830 void set container(RenderObjectWithChildMixin<RenderBox> value) {
831 if (_container != value) { 831 if (_container != value) {
(...skipping 16 matching lines...) Expand all
848 super._buildIfDirty(); 848 super._buildIfDirty();
849 if (root.parent == null) { 849 if (root.parent == null) {
850 // we haven't attached it yet 850 // we haven't attached it yet
851 assert(_container.child == null); 851 assert(_container.child == null);
852 _container.child = root; 852 _container.child = root;
853 } 853 }
854 assert(root.parent == _container); 854 assert(root.parent == _container);
855 } 855 }
856 856
857 UINode build() => builder(); 857 UINode build() => builder();
858 } 858 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698