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 '../app.dart'; | 10 import '../app.dart'; |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 class UINodeAppView extends AppView { | 748 class UINodeAppView extends AppView { |
749 | 749 |
750 UINodeAppView({ RenderView renderViewOverride: null }) | 750 UINodeAppView({ RenderView renderViewOverride: null }) |
751 : super(renderViewOverride: renderViewOverride) { | 751 : super(renderViewOverride: renderViewOverride) { |
752 assert(_appView == null); | 752 assert(_appView == null); |
753 } | 753 } |
754 | 754 |
755 static UINodeAppView _appView; | 755 static UINodeAppView _appView; |
756 static AppView get appView => _appView; | 756 static AppView get appView => _appView; |
757 static void initUINodeAppView({ RenderView renderViewOverride: null }) { | 757 static void initUINodeAppView({ RenderView renderViewOverride: null }) { |
758 _appView = new UINodeAppView(renderViewOverride: renderViewOverride); | 758 if (_appView == null) |
| 759 _appView = new UINodeAppView(renderViewOverride: renderViewOverride); |
759 } | 760 } |
760 | 761 |
761 void dispatchEvent(sky.Event event, HitTestResult result) { | 762 void dispatchEvent(sky.Event event, HitTestResult result) { |
762 assert(_appView == this); | 763 assert(_appView == this); |
763 super.dispatchEvent(event, result); | 764 super.dispatchEvent(event, result); |
764 for (HitTestEntry entry in result.path.reversed) { | 765 for (HitTestEntry entry in result.path.reversed) { |
765 UINode target = RenderObjectWrapper._getMounted(entry.target); | 766 UINode target = RenderObjectWrapper._getMounted(entry.target); |
766 if (target == null) | 767 if (target == null) |
767 continue; | 768 continue; |
768 RenderObject targetRoot = target.root; | 769 RenderObject targetRoot = target.root; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 // we haven't attached it yet | 851 // we haven't attached it yet |
851 assert(_container.child == null); | 852 assert(_container.child == null); |
852 _container.child = root; | 853 _container.child = root; |
853 } | 854 } |
854 assert(root.parent == _container); | 855 assert(root.parent == _container); |
855 } | 856 } |
856 | 857 |
857 UINode build() => builder(); | 858 UINode build() => builder(); |
858 | 859 |
859 } | 860 } |
OLD | NEW |