[base_shell] Remove usages of UserController and UserWatcher interfaces.
- Base shell is stopped right after login, so there's no point in
sending it logout events
- Base shell will be the only way to control login/logout, so there's no
point in sending it logout events
MF-120 #comment
TESTED: paved, manual login
Change-Id: I85a3d5b3af91705bc0be4f199a92fa0c2467085d
diff --git a/lib/base_shell/BUILD.gn b/lib/base_shell/BUILD.gn
index acd0aa6..79aed2f 100644
--- a/lib/base_shell/BUILD.gn
+++ b/lib/base_shell/BUILD.gn
@@ -11,7 +11,6 @@
"base_model.dart",
"netstack_model.dart",
"user_manager.dart",
- "user_watcher_impl.dart",
]
deps = [
diff --git a/lib/base_shell/lib/user_manager.dart b/lib/base_shell/lib/user_manager.dart
index fd3da98..15e81de 100644
--- a/lib/base_shell/lib/user_manager.dart
+++ b/lib/base_shell/lib/user_manager.dart
@@ -8,15 +8,10 @@
import 'package:lib.app.dart/logging.dart';
import 'package:lib.ui.flutter/child_view.dart';
-import 'user_watcher_impl.dart';
-
/// Handles adding, removing, and logging, and controlling users.
class BaseShellUserManager {
final UserProvider _userProvider;
- UserControllerProxy _userControllerProxy;
- UserWatcherImpl _userWatcherImpl;
-
final StreamController<void> _userLogoutController =
StreamController<void>.broadcast();
@@ -53,25 +48,15 @@
/// to open a [ChildViewConnection] to display the session shell.
InterfaceHandle<ViewOwner> login(String accountId,
InterfaceHandle<ServiceProvider> serviceProviderHandle) {
- _userControllerProxy?.ctrl?.close();
- _userControllerProxy = UserControllerProxy();
- _userWatcherImpl?.close();
- _userWatcherImpl = UserWatcherImpl(onUserLogout: () {
- _userLogoutController.add(null);
- });
-
final InterfacePair<ViewOwner> viewOwner = InterfacePair<ViewOwner>();
final UserLoginParams params = UserLoginParams(
accountId: accountId,
viewOwner: viewOwner.passRequest(),
services: serviceProviderHandle,
- userController: _userControllerProxy.ctrl.request(),
);
_userProvider.login(params);
- _userControllerProxy.watch(_userWatcherImpl.getHandle());
-
return viewOwner.passHandle();
}
@@ -99,9 +84,7 @@
}
void close() {
- _userControllerProxy.ctrl.close();
_userLogoutController.close();
- _userWatcherImpl.close();
}
}
diff --git a/lib/base_shell/lib/user_watcher_impl.dart b/lib/base_shell/lib/user_watcher_impl.dart
deleted file mode 100644
index b43ea98..0000000
--- a/lib/base_shell/lib/user_watcher_impl.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'package:fidl_fuchsia_modular/fidl.dart';
-import 'package:fidl/fidl.dart';
-import 'package:flutter/widgets.dart';
-
-/// Watches for changes to the user logged in status.
-class UserWatcherImpl extends UserWatcher {
- final UserWatcherBinding _binding = new UserWatcherBinding();
-
- /// Called when the user logs out.
- final VoidCallback onUserLogout;
-
- /// Constructor.
- UserWatcherImpl({this.onUserLogout});
-
- /// Gets the handle of this [UserWatcher].
- InterfaceHandle<UserWatcher> getHandle() => _binding.wrap(this);
-
- @override
- void onLogout() {
- onUserLogout?.call();
- }
-
- /// Closes any handles owned by this [UserWatcher].
- void close() => _binding.close();
-}