[scenic] Move EmbeddedModule to eventpairs
Now that upper layers no longer use this, migrate callers to the new
data type.
TEST: Ran SysUI; launched a story
SCN-898 #comment
SCN-1033 #comment
Change-Id: I322804ee74e15925e9bd563e4d500f735ecfabc4
diff --git a/public/dart/fuchsia_modular/lib/src/module/embedded_module.dart b/public/dart/fuchsia_modular/lib/src/module/embedded_module.dart
index 3862bde..a6bb8e8 100644
--- a/public/dart/fuchsia_modular/lib/src/module/embedded_module.dart
+++ b/public/dart/fuchsia_modular/lib/src/module/embedded_module.dart
@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:fidl/fidl.dart';
import 'package:fidl_fuchsia_modular/fidl_async.dart' as modular;
import 'package:fidl_fuchsia_ui_gfx/fidl_async.dart' as gfx;
-import 'package:fidl_fuchsia_ui_viewsv1token/fidl_async.dart' as views;
import 'package:meta/meta.dart';
/// The result of calling [Module#embedModule] on the Module.
@@ -14,7 +12,7 @@
/// a [gfx.ImportToken] object. The combination of these objects can be used to
/// embed the new module's view into your own view hierarchy.
class EmbeddedModule {
- /// The |modular.ModuleController| which can be used to control the embedded
+ /// The [modular.ModuleController] which can be used to control the embedded
/// module.
final modular.ModuleController moduleController;
@@ -23,22 +21,10 @@
/// screen.
final gfx.ImportToken viewHolderToken;
- /// DEPRECATED, for transition purposes only
- final InterfaceHandle<views.ViewOwner> viewOwner;
-
/// Constructor
EmbeddedModule({
@required this.moduleController,
@required this.viewHolderToken,
- }) : viewOwner = null,
- assert(moduleController != null),
+ }) : assert(moduleController != null),
assert(viewHolderToken != null);
-
- /// DEPRECATED, for transition purposes only
- EmbeddedModule.fromViewOwner({
- @required this.moduleController,
- @required this.viewOwner,
- }) : viewHolderToken = null,
- assert(moduleController != null),
- assert(viewOwner != null);
}
diff --git a/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart b/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
index 41b8ec1..8431767 100644
--- a/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
+++ b/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
@@ -122,23 +122,7 @@
@required String name,
@required modular.Intent intent,
}) async {
- if (name == null || name.isEmpty) {
- throw ArgumentError.value(
- name, 'name', 'embedModule should be called with a valid name');
- }
- if (intent == null) {
- throw ArgumentError.notNull('intent');
- }
-
- final moduleController = modular.ModuleControllerProxy();
- final viewOwner = new InterfacePair<views.ViewOwner>();
- final status = await _getContext().embedModule(
- name, intent, moduleController.ctrl.request(), viewOwner.passRequest());
-
- _validateStartModuleStatus(status, name, intent);
-
- return EmbeddedModule.fromViewOwner(
- moduleController: moduleController, viewOwner: viewOwner.passHandle());
+ return embedModuleNew(name: name, intent: intent);
}
@override