[go: nahoru, domu]

Re-land "Mash cleanup: begin converting login mojo to C++"

This re-lands db977c4b6c6bc31bd6d601273acc921435edda83

Change to original: LoginUserInfo::fingerprint_state is
default initialized

Original change's description:
> Mash cleanup: begin converting login mojo to C++
>
> This patch moves types implemented in login_user_info.mojom to
> //ash/public/cpp/login_types.h. The handful of methods on
> mojom::LoginScreen which used these types are moved to C++
> interfaces.
>
> There are two new public-facing C++ interfaces:
> 1. ash::LoginScreen, which is a direct translation of the mojom.
>    This is implemented by ash::LoginScreenController.
> 2. ash::LoginScreenModel, which is used for the methods that
>    were simple thunks in LoginScreenController.
>    (LoginDataDispatcher implements this interface.)
>
> Bug: 958206
> Change-Id: I329d606b234556bf05aee40849f3aa5ccc6c0be0

TBR=tsepez@chromium.org,xiyuan@chromium.org

Bug: 958206
Change-Id: I9567af3331638e38590f143f1b43e55d4b609c81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626700
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662757}
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index 48bd1e8..169b9c4 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -306,6 +306,10 @@
   login_screen_client_.FlushForTesting();
 }
 
+LoginScreenModel* LoginScreenController::GetModel() {
+  return DataDispatcher();
+}
+
 void LoginScreenController::SetClient(mojom::LoginScreenClientPtr client) {
   login_screen_client_ = std::move(client);
 }
@@ -354,18 +358,6 @@
   NOTIMPLEMENTED();
 }
 
-void LoginScreenController::ShowUserPodCustomIcon(
-    const AccountId& account_id,
-    mojom::EasyUnlockIconOptionsPtr icon) {
-  DataDispatcher()->ShowEasyUnlockIcon(account_id, icon);
-}
-
-void LoginScreenController::HideUserPodCustomIcon(const AccountId& account_id) {
-  auto icon_options = mojom::EasyUnlockIconOptions::New();
-  icon_options->icon = mojom::EasyUnlockIconId::NONE;
-  DataDispatcher()->ShowEasyUnlockIcon(account_id, icon_options);
-}
-
 void LoginScreenController::SetAuthType(
     const AccountId& account_id,
     proximity_auth::mojom::AuthType auth_type,
@@ -380,13 +372,6 @@
   }
 }
 
-void LoginScreenController::SetUserList(
-    std::vector<mojom::LoginUserInfoPtr> users) {
-  DCHECK(DataDispatcher());
-
-  DataDispatcher()->NotifyUsers(users);
-}
-
 void LoginScreenController::SetPinEnabledForUser(const AccountId& account_id,
                                                  bool is_enabled) {
   // Chrome will update pin pod state every time user tries to authenticate.
@@ -395,12 +380,6 @@
     DataDispatcher()->SetPinEnabledForUser(account_id, is_enabled);
 }
 
-void LoginScreenController::SetFingerprintState(const AccountId& account_id,
-                                                mojom::FingerprintState state) {
-  if (DataDispatcher())
-    DataDispatcher()->SetFingerprintState(account_id, state);
-}
-
 void LoginScreenController::NotifyFingerprintAuthResult(
     const AccountId& account_id,
     bool successful) {
@@ -408,12 +387,6 @@
     DataDispatcher()->NotifyFingerprintAuthResult(account_id, successful);
 }
 
-void LoginScreenController::SetAvatarForUser(const AccountId& account_id,
-                                             mojom::UserAvatarPtr avatar) {
-  for (auto& observer : observers_)
-    observer.SetAvatarForUser(account_id, avatar);
-}
-
 void LoginScreenController::EnableAuthForUser(const AccountId& account_id) {
   if (DataDispatcher())
     DataDispatcher()->EnableAuthForUser(account_id);
@@ -456,27 +429,6 @@
     DataDispatcher()->SetPublicSessionDisplayName(account_id, display_name);
 }
 
-void LoginScreenController::SetPublicSessionLocales(
-    const AccountId& account_id,
-    std::vector<mojom::LocaleItemPtr> locales,
-    const std::string& default_locale,
-    bool show_advanced_view) {
-  if (DataDispatcher()) {
-    DataDispatcher()->SetPublicSessionLocales(
-        account_id, locales, default_locale, show_advanced_view);
-  }
-}
-
-void LoginScreenController::SetPublicSessionKeyboardLayouts(
-    const AccountId& account_id,
-    const std::string& locale,
-    std::vector<mojom::InputMethodItemPtr> keyboard_layouts) {
-  if (DataDispatcher()) {
-    DataDispatcher()->SetPublicSessionKeyboardLayouts(account_id, locale,
-                                                      keyboard_layouts);
-  }
-}
-
 void LoginScreenController::SetPublicSessionShowFullManagementDisclosure(
     bool is_full_management_disclosure_needed) {
   if (DataDispatcher()) {