Commit 6d3e637f authored by Sarah Hu's avatar Sarah Hu Committed by Commit Bot

Revert "cros: Update visibility of guest and apps button in the shelf."

This reverts commit fa0ab3e4.

Add user button is not showing up correctly due to this CL, revert it now
and will investigate the cause.

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

Change-Id: I2ab8ccd357f2ef27d3f9d1d53733cad45e65b6c8
Reviewed-on: https://chromium-review.googlesource.com/1155757
Commit-Queue: Xiaoyin Hu <xiaoyinh@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579228}
parent 116ed40d
...@@ -315,11 +315,16 @@ void LoginScreenController::SetAuthType( ...@@ -315,11 +315,16 @@ void LoginScreenController::SetAuthType(
} }
} }
void LoginScreenController::SetUserList( void LoginScreenController::LoadUsers(
std::vector<mojom::LoginUserInfoPtr> users) { std::vector<mojom::LoginUserInfoPtr> users,
bool show_guest) {
DCHECK(DataDispatcher()); DCHECK(DataDispatcher());
DataDispatcher()->NotifyUsers(users); DataDispatcher()->NotifyUsers(users);
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget()
->login_shelf_view()
->SetAllowLoginAsGuest(show_guest);
} }
void LoginScreenController::SetPinEnabledForUser(const AccountId& account_id, void LoginScreenController::SetPinEnabledForUser(const AccountId& account_id,
...@@ -409,19 +414,11 @@ void LoginScreenController::SetKioskApps( ...@@ -409,19 +414,11 @@ void LoginScreenController::SetKioskApps(
->SetKioskApps(std::move(kiosk_apps)); ->SetKioskApps(std::move(kiosk_apps));
} }
void LoginScreenController::NotifyOobeDialogState( void LoginScreenController::NotifyOobeDialogVisibility(bool visible) {
mojom::OobeDialogState state) {
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget()
->login_shelf_view()
->SetLoginDialogState(state);
}
void LoginScreenController::SetAllowLoginAsGuest(bool allow_guest) {
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow()) Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget() ->shelf_widget()
->login_shelf_view() ->login_shelf_view()
->SetAllowLoginAsGuest(allow_guest); ->SetLoginDialogVisible(visible);
} }
void LoginScreenController::SetAddUserButtonEnabled(bool enable) { void LoginScreenController::SetAddUserButtonEnabled(bool enable) {
......
...@@ -111,7 +111,8 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen { ...@@ -111,7 +111,8 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void SetAuthType(const AccountId& account_id, void SetAuthType(const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type, proximity_auth::mojom::AuthType auth_type,
const base::string16& initial_value) override; const base::string16& initial_value) override;
void SetUserList(std::vector<mojom::LoginUserInfoPtr> users) override; void LoadUsers(std::vector<mojom::LoginUserInfoPtr> users,
bool show_guest) override;
void SetPinEnabledForUser(const AccountId& account_id, void SetPinEnabledForUser(const AccountId& account_id,
bool is_enabled) override; bool is_enabled) override;
void SetAvatarForUser(const AccountId& account_id, void SetAvatarForUser(const AccountId& account_id,
...@@ -138,9 +139,8 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen { ...@@ -138,9 +139,8 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void SetFingerprintUnlockState(const AccountId& account_id, void SetFingerprintUnlockState(const AccountId& account_id,
mojom::FingerprintUnlockState state) override; mojom::FingerprintUnlockState state) override;
void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps) override; void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps) override;
void NotifyOobeDialogState(mojom::OobeDialogState state) override; void NotifyOobeDialogVisibility(bool is_visible) override;
void SetAddUserButtonEnabled(bool enable) override; void SetAddUserButtonEnabled(bool enable) override;
void SetAllowLoginAsGuest(bool allow_guest) override;
// Flushes the mojo pipes - to be used in tests. // Flushes the mojo pipes - to be used in tests.
void FlushForTesting(); void FlushForTesting();
......
...@@ -12,33 +12,6 @@ import "components/account_id/interfaces/account_id.mojom"; ...@@ -12,33 +12,6 @@ import "components/account_id/interfaces/account_id.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
import "mojo/public/mojom/base/time.mojom"; import "mojo/public/mojom/base/time.mojom";
// State of the Oobe UI dialog.
enum OobeDialogState {
// Oobe UI dialog is currently hidden.
HIDDEN,
// Showing gaia signin screen.
GAIA_SIGNIN,
// Showing wrong hardware identification screen.
WRONG_HWID_WARNING,
// Showing supervised user creation screen.
SUPERVISED_USER_CREATION_FLOW,
// Showing SAML password confirmation screen.
SAML_PASSWORD_CONFIRM,
// Showing password changed screen.
PASSWORD_CHANGED,
// Showing device enrollment screen.
ENROLLMENT,
// Showing error screen.
ERROR,
};
// Allows clients (e.g. Chrome browser) to control the ash login/lock/user-add // Allows clients (e.g. Chrome browser) to control the ash login/lock/user-add
// screens. // screens.
interface LoginScreen { interface LoginScreen {
...@@ -86,9 +59,10 @@ interface LoginScreen { ...@@ -86,9 +59,10 @@ interface LoginScreen {
proximity_auth.mojom.AuthType auth_type, proximity_auth.mojom.AuthType auth_type,
mojo_base.mojom.String16 initial_value); mojo_base.mojom.String16 initial_value);
// Set the users who are displayed on the login UI. |users| is filtered // Requests to load users in the lock screen.
// and does not correspond to every user on the device. // |users|: A list of users who can unlock the device.
SetUserList(array<LoginUserInfo> users); // |show_guest|: Whether to show guest session button.
LoadUsers(array<LoginUserInfo> users, bool show_guest);
// Notification if pin is enabled or disabled for the given user. // Notification if pin is enabled or disabled for the given user.
// |account_id|: The account id of the user in the user pod. // |account_id|: The account id of the user in the user pod.
...@@ -156,17 +130,13 @@ interface LoginScreen { ...@@ -156,17 +130,13 @@ interface LoginScreen {
// Update the kiosk app data for the login screen. // Update the kiosk app data for the login screen.
SetKioskApps(array<KioskAppInfo> kiosk_apps); SetKioskApps(array<KioskAppInfo> kiosk_apps);
// Called when the dialog hosting oobe has changed state. The oobe dialog // Called when the dialog hosting oobe has changed visibility. The oobe dialog
// provides support for any part of login that is implemented in JS/HTML, such // provides support for any part of login that is implemented in JS/HTML, such
// as add user or powerwash. // as add user or powerwash.
NotifyOobeDialogState(OobeDialogState state); NotifyOobeDialogVisibility(bool is_visible);
// Sets whether users can be added from the login screen. // Sets whether users can be added from the login screen.
SetAddUserButtonEnabled(bool enable); SetAddUserButtonEnabled(bool enable);
// Sets if the guest button on the login shelf can be shown. Even if set to
// true the button may still not be visible.
SetAllowLoginAsGuest(bool allow_guest);
}; };
// Allows ash lock screen to control a client (e.g. Chrome browser). Requests // Allows ash lock screen to control a client (e.g. Chrome browser). Requests
......
...@@ -410,8 +410,8 @@ void LoginShelfView::SetKioskApps( ...@@ -410,8 +410,8 @@ void LoginShelfView::SetKioskApps(
UpdateUi(); UpdateUi();
} }
void LoginShelfView::SetLoginDialogState(mojom::OobeDialogState state) { void LoginShelfView::SetLoginDialogVisible(bool visible) {
dialog_state_ = state; dialog_visible_ = visible;
UpdateUi(); UpdateUi();
} }
...@@ -478,33 +478,12 @@ void LoginShelfView::UpdateUi() { ...@@ -478,33 +478,12 @@ void LoginShelfView::UpdateUi() {
// TODO(agawronska): Implement full list of conditions for buttons visibility, // TODO(agawronska): Implement full list of conditions for buttons visibility,
// when views based shelf if enabled during OOBE. https://crbug.com/798869 // when views based shelf if enabled during OOBE. https://crbug.com/798869
bool is_login_primary = (session_state == SessionState::LOGIN_PRIMARY); bool is_login_primary = (session_state == SessionState::LOGIN_PRIMARY);
bool dialog_visible = dialog_state_ != mojom::OobeDialogState::HIDDEN;
// Show guest button if:
// 1. It's in login screen.
// 2. Guest login is allowed.
// 3. OOBE UI dialog is not currently showing wrong HWID warning screen or
// SAML password confirmation screen.
GetViewByID(kBrowseAsGuest) GetViewByID(kBrowseAsGuest)
->SetVisible( ->SetVisible(allow_guest_ && !dialog_visible_ && is_login_primary);
allow_guest_ && GetViewByID(kAddUser)->SetVisible(!dialog_visible_ && is_login_primary);
dialog_state_ != mojom::OobeDialogState::WRONG_HWID_WARNING &&
dialog_state_ != mojom::OobeDialogState::SAML_PASSWORD_CONFIRM &&
is_login_primary);
// Show add user button when it's in login screen and OobeUI dialog is not
// visible.
GetViewByID(kAddUser)->SetVisible(!dialog_visible && is_login_primary);
// Show kiosk apps button if:
// 1. It's in login screen.
// 2. There're Kiosk apps availble.
// 3. Oobe UI dialog is not visible or is currently showing gaia signin
// screen.
kiosk_apps_button_->SetVisible( kiosk_apps_button_->SetVisible(
(!dialog_visible || !dialog_visible_ && kiosk_apps_button_->HasApps() && is_login_primary);
dialog_state_ == mojom::OobeDialogState::GAIA_SIGNIN) &&
kiosk_apps_button_->HasApps() && is_login_primary);
Layout(); Layout();
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/lock_screen_action/lock_screen_action_background_observer.h" #include "ash/lock_screen_action/lock_screen_action_background_observer.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h" #include "ash/public/interfaces/kiosk_app_info.mojom.h"
#include "ash/public/interfaces/login_screen.mojom.h"
#include "ash/shutdown_controller.h" #include "ash/shutdown_controller.h"
#include "ash/tray_action/tray_action_observer.h" #include "ash/tray_action/tray_action_observer.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
...@@ -64,8 +63,9 @@ class ASH_EXPORT LoginShelfView : public views::View, ...@@ -64,8 +63,9 @@ class ASH_EXPORT LoginShelfView : public views::View,
// Sets the list of kiosk apps that can be launched from the login shelf. // Sets the list of kiosk apps that can be launched from the login shelf.
void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps); void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps);
// Sets the state of the login dialog. // Sets if the login dialog is visible. This hides some of the buttons on the
void SetLoginDialogState(mojom::OobeDialogState state); // LoginShelf.
void SetLoginDialogVisible(bool visible);
// Sets if the guest button on the login shelf can be shown. Even if set to // Sets if the guest button on the login shelf can be shown. Even if set to
// true the button may still not be visible. // true the button may still not be visible.
...@@ -101,7 +101,7 @@ class ASH_EXPORT LoginShelfView : public views::View, ...@@ -101,7 +101,7 @@ class ASH_EXPORT LoginShelfView : public views::View,
// policy updates, session state changes etc. // policy updates, session state changes etc.
void UpdateUi(); void UpdateUi();
mojom::OobeDialogState dialog_state_ = mojom::OobeDialogState::HIDDEN; bool dialog_visible_ = false;
bool allow_guest_ = true; bool allow_guest_ = true;
LockScreenActionBackgroundController* lock_screen_action_background_; LockScreenActionBackgroundController* lock_screen_action_background_;
......
...@@ -291,68 +291,23 @@ TEST_F(LoginShelfViewTest, SetAllowLoginByGuest) { ...@@ -291,68 +291,23 @@ TEST_F(LoginShelfViewTest, SetAllowLoginByGuest) {
// However, SetAllowLoginAsGuest(true) does not mean that the guest button is // However, SetAllowLoginAsGuest(true) does not mean that the guest button is
// always visible. // always visible.
login_shelf_view_->SetLoginDialogState( login_shelf_view_->SetLoginDialogVisible(true);
mojom::OobeDialogState::SAML_PASSWORD_CONFIRM);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown})); EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
} }
TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) { TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogVisibilityChange) {
NotifySessionStateChanged(SessionState::LOGIN_PRIMARY); NotifySessionStateChanged(SessionState::LOGIN_PRIMARY);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown, EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown,
LoginShelfView::kBrowseAsGuest, LoginShelfView::kBrowseAsGuest,
LoginShelfView::kAddUser})); LoginShelfView::kAddUser}));
// Add user button is always hidden if dialog state != login_shelf_view_->SetLoginDialogVisible(true);
// OobeDialogState::HIDDEN. EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::GAIA_SIGNIN);
EXPECT_TRUE(ShowsShelfButtons(
{LoginShelfView::kShutdown, LoginShelfView::kBrowseAsGuest}));
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::HIDDEN); login_shelf_view_->SetLoginDialogVisible(false);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown, EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown,
LoginShelfView::kBrowseAsGuest, LoginShelfView::kBrowseAsGuest,
LoginShelfView::kAddUser})); LoginShelfView::kAddUser}));
// Guest button is hidden if dialog state ==
// OobeDialogState::WRONG_HWID_WARNING or SAML_PASSWORD_CONFIRM.
login_shelf_view_->SetLoginDialogState(
mojom::OobeDialogState::WRONG_HWID_WARNING);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
login_shelf_view_->SetLoginDialogState(
mojom::OobeDialogState::SAML_PASSWORD_CONFIRM);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::GAIA_SIGNIN);
EXPECT_TRUE(ShowsShelfButtons(
{LoginShelfView::kShutdown, LoginShelfView::kBrowseAsGuest}));
// Guest button is hidden if SetAllowLoginAsGuest(false).
login_shelf_view_->SetAllowLoginAsGuest(false /*allow_guest*/);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
// Kiosk app button is visible when dialog state == OobeDialogState::HIDDEN
// or GAIA_SIGNIN.
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::GAIA_SIGNIN);
std::vector<mojom::KioskAppInfoPtr> kiosk_apps;
kiosk_apps.push_back(mojom::KioskAppInfo::New());
login_shelf_view_->SetKioskApps(std::move(kiosk_apps));
EXPECT_TRUE(
ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kApps}));
login_shelf_view_->SetLoginDialogState(
mojom::OobeDialogState::SAML_PASSWORD_CONFIRM);
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown}));
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::HIDDEN);
EXPECT_TRUE(
ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kAddUser,
LoginShelfView::kApps}));
// Kiosk app button is hidden when no app exists.
login_shelf_view_->SetKioskApps(std::vector<mojom::KioskAppInfoPtr>());
EXPECT_TRUE(
ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kAddUser}));
} }
TEST_F(LoginShelfViewTest, ClickShutdownButton) { TEST_F(LoginShelfViewTest, ClickShutdownButton) {
......
...@@ -81,10 +81,9 @@ ViewsScreenLocker::~ViewsScreenLocker() { ...@@ -81,10 +81,9 @@ ViewsScreenLocker::~ViewsScreenLocker() {
void ViewsScreenLocker::Init() { void ViewsScreenLocker::Init() {
lock_time_ = base::TimeTicks::Now(); lock_time_ = base::TimeTicks::Now();
user_selection_screen_->Init(screen_locker_->users()); user_selection_screen_->Init(screen_locker_->users());
LoginScreenClient::Get()->login_screen()->SetUserList( LoginScreenClient::Get()->login_screen()->LoadUsers(
user_selection_screen_->UpdateAndReturnUserListForMojo()); user_selection_screen_->UpdateAndReturnUserListForMojo(),
LoginScreenClient::Get()->login_screen()->SetAllowLoginAsGuest( false /* show_guests */);
false /*show_guest*/);
if (!ime_state_.get()) if (!ime_state_.get())
ime_state_ = input_method::InputMethodManager::Get()->GetActiveIMEState(); ime_state_ = input_method::InputMethodManager::Get()->GetActiveIMEState();
......
...@@ -74,9 +74,8 @@ void LoginDisplayMojo::Init(const user_manager::UserList& filtered_users, ...@@ -74,9 +74,8 @@ void LoginDisplayMojo::Init(const user_manager::UserList& filtered_users,
UserSelectionScreen* user_selection_screen = host_->user_selection_screen(); UserSelectionScreen* user_selection_screen = host_->user_selection_screen();
user_selection_screen->Init(filtered_users); user_selection_screen->Init(filtered_users);
client->login_screen()->SetUserList( client->login_screen()->LoadUsers(
user_selection_screen->UpdateAndReturnUserListForMojo()); user_selection_screen->UpdateAndReturnUserListForMojo(), show_guest);
client->login_screen()->SetAllowLoginAsGuest(show_guest);
user_selection_screen->SetUsersLoaded(true /*loaded*/); user_selection_screen->SetUsersLoaded(true /*loaded*/);
// Enable pin for any users who can use it. // Enable pin for any users who can use it.
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "chrome/browser/chromeos/login/ui/oobe_ui_dialog_delegate.h" #include "chrome/browser/chromeos/login/ui/oobe_ui_dialog_delegate.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/interfaces/login_screen.mojom.h"
#include "chrome/browser/chromeos/login/screens/gaia_view.h" #include "chrome/browser/chromeos/login/screens/gaia_view.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h" #include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
...@@ -95,8 +94,7 @@ content::WebContents* OobeUIDialogDelegate::GetWebContents() { ...@@ -95,8 +94,7 @@ content::WebContents* OobeUIDialogDelegate::GetWebContents() {
} }
void OobeUIDialogDelegate::Show() { void OobeUIDialogDelegate::Show() {
LoginScreenClient::Get()->login_screen()->NotifyOobeDialogState( LoginScreenClient::Get()->login_screen()->NotifyOobeDialogVisibility(true);
ash::mojom::OobeDialogState::GAIA_SIGNIN);
dialog_widget_->Show(); dialog_widget_->Show();
} }
...@@ -113,16 +111,14 @@ void OobeUIDialogDelegate::ShowFullScreen() { ...@@ -113,16 +111,14 @@ void OobeUIDialogDelegate::ShowFullScreen() {
void OobeUIDialogDelegate::Hide() { void OobeUIDialogDelegate::Hide() {
if (!dialog_widget_) if (!dialog_widget_)
return; return;
LoginScreenClient::Get()->login_screen()->NotifyOobeDialogState( LoginScreenClient::Get()->login_screen()->NotifyOobeDialogVisibility(false);
ash::mojom::OobeDialogState::HIDDEN);
dialog_widget_->Hide(); dialog_widget_->Hide();
} }
void OobeUIDialogDelegate::Close() { void OobeUIDialogDelegate::Close() {
if (!dialog_widget_) if (!dialog_widget_)
return; return;
LoginScreenClient::Get()->login_screen()->NotifyOobeDialogState( LoginScreenClient::Get()->login_screen()->NotifyOobeDialogVisibility(false);
ash::mojom::OobeDialogState::HIDDEN);
dialog_widget_->Close(); dialog_widget_->Close();
} }
......
...@@ -301,9 +301,6 @@ cr.define('login', function() { ...@@ -301,9 +301,6 @@ cr.define('login', function() {
set signinUIState(state) { set signinUIState(state) {
this.signinUIState_ = state; this.signinUIState_ = state;
this.updateUI_(); this.updateUI_();
if (Oobe.getInstance().showingViewsLogin)
chrome.send('updateSigninUIState', [state]);
}, },
/** /**
......
...@@ -706,11 +706,6 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { ...@@ -706,11 +706,6 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
$('login-header-bar').showCreateSupervisedButton = $('login-header-bar').showCreateSupervisedButton =
data.supervisedUsersCanCreate; data.supervisedUsersCanCreate;
$('login-header-bar').showGuestButton = data.guestSignin; $('login-header-bar').showGuestButton = data.guestSignin;
if (Oobe.getInstance().showingViewsLogin) {
chrome.send(
'showGuestButton',
[data.guestSignin && !this.closable && this.isAtTheBeginning()]);
}
// Reset SAML // Reset SAML
this.classList.toggle('full-width', false); this.classList.toggle('full-width', false);
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "chrome/browser/lifetime/browser_shutdown.h" #include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/ash/login_screen_client.h"
#include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
...@@ -580,9 +579,6 @@ void GaiaScreenHandler::RegisterMessages() { ...@@ -580,9 +579,6 @@ void GaiaScreenHandler::RegisterMessages() {
AddCallback("updateOobeDialogSize", AddCallback("updateOobeDialogSize",
&GaiaScreenHandler::HandleUpdateOobeDialogSize); &GaiaScreenHandler::HandleUpdateOobeDialogSize);
AddCallback("hideOobeDialog", &GaiaScreenHandler::HandleHideOobeDialog); AddCallback("hideOobeDialog", &GaiaScreenHandler::HandleHideOobeDialog);
AddCallback("updateSigninUIState",
&GaiaScreenHandler::HandleUpdateSigninUIState);
AddCallback("showGuestButton", &GaiaScreenHandler::HandleShowGuestButton);
// Allow UMA metrics collection from JS. // Allow UMA metrics collection from JS.
web_ui()->AddMessageHandler(std::make_unique<MetricsHandler>()); web_ui()->AddMessageHandler(std::make_unique<MetricsHandler>());
...@@ -856,26 +852,6 @@ void GaiaScreenHandler::HandleGetIsSamlUserPasswordless( ...@@ -856,26 +852,6 @@ void GaiaScreenHandler::HandleGetIsSamlUserPasswordless(
base::Value(false) /* isSamlUserPasswordless */); base::Value(false) /* isSamlUserPasswordless */);
} }
void GaiaScreenHandler::HandleUpdateSigninUIState(int state) {
if (!ash::features::IsViewsLoginEnabled() ||
!LoginScreenClient::HasInstance()) {
return;
}
auto dialog_state = static_cast<ash::mojom::OobeDialogState>(state);
DCHECK(ash::mojom::IsKnownEnumValue(dialog_state));
LoginScreenClient::Get()->login_screen()->NotifyOobeDialogState(dialog_state);
}
void GaiaScreenHandler::HandleShowGuestButton(bool show) {
if (!ash::features::IsViewsLoginEnabled() ||
!LoginScreenClient::HasInstance()) {
return;
}
LoginScreenClient::Get()->login_screen()->SetAllowLoginAsGuest(show);
}
void GaiaScreenHandler::OnShowAddUser() { void GaiaScreenHandler::OnShowAddUser() {
signin_screen_handler_->is_account_picker_showing_first_time_ = false; signin_screen_handler_->is_account_picker_showing_first_time_ = false;
lock_screen_utils::EnforcePolicyInputMethods(std::string()); lock_screen_utils::EnforcePolicyInputMethods(std::string());
......
...@@ -137,9 +137,6 @@ class GaiaScreenHandler : public BaseScreenHandler, ...@@ -137,9 +137,6 @@ class GaiaScreenHandler : public BaseScreenHandler,
void HandleGetIsSamlUserPasswordless(const std::string& callback_id, void HandleGetIsSamlUserPasswordless(const std::string& callback_id,
const std::string& typed_email, const std::string& typed_email,
const std::string& gaia_id); const std::string& gaia_id);
void HandleUpdateSigninUIState(int state);
void HandleShowGuestButton(bool show);
void OnShowAddUser(); void OnShowAddUser();
// Really handles the complete login message. // Really handles the complete login message.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment