Commit ff20e238 authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

cros: Launch the Account Access help app from "Learn more" button.

Bug: 863620
Change-Id: Id15fc12e23ca4fd51b92454d27d87133120aee82
Reviewed-on: https://chromium-review.googlesource.com/1157249Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580332}
parent 8847d90d
......@@ -440,6 +440,10 @@ void LoginScreenController::ShowResetScreen() {
login_screen_client_->ShowResetScreen();
}
void LoginScreenController::ShowAccountAccessHelpApp() {
login_screen_client_->ShowAccountAccessHelpApp();
}
void LoginScreenController::DoAuthenticateUser(const AccountId& account_id,
const std::string& password,
bool authenticated_by_pin,
......
......@@ -85,6 +85,7 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void LaunchKioskApp(const std::string& app_id);
void LaunchArcKioskApp(const AccountId& account_id);
void ShowResetScreen();
void ShowAccountAccessHelpApp();
// Add or remove an observer.
void AddObserver(LoginScreenControllerObserver* observer);
......
......@@ -71,6 +71,7 @@ class MockLoginScreenClient : public mojom::LoginScreenClient {
MOCK_METHOD1(LaunchKioskApp, void(const std::string& app_id));
MOCK_METHOD1(LaunchArcKioskApp, void(const AccountId& account_id));
MOCK_METHOD0(ShowResetScreen, void());
MOCK_METHOD0(ShowAccountAccessHelpApp, void());
private:
bool authenticate_user_callback_result_ = true;
......
......@@ -128,7 +128,7 @@ class AuthErrorLearnMoreButton : public views::Button,
}
void ButtonPressed(Button* sender, const ui::Event& event) override {
// TODO(qnnguyen): Launch the help app for signin trouble.
Shell::Get()->login_screen_controller()->ShowAccountAccessHelpApp();
}
};
......
......@@ -237,4 +237,7 @@ interface LoginScreenClient {
// Show the powerwash (device reset) dialog.
ShowResetScreen();
// Show the help app for when users have trouble signing in to their account.
ShowAccountAccessHelpApp();
};
......@@ -142,6 +142,8 @@ void FakeLoginDisplayHost::ShowFeedback() {}
void FakeLoginDisplayHost::ShowResetScreen() {}
void FakeLoginDisplayHost::ShowAccountAccessHelpApp() {}
void FakeLoginDisplayHost::ShowDialogForCaptivePortal() {}
void FakeLoginDisplayHost::HideDialogForCaptivePortal() {}
......
......@@ -66,6 +66,7 @@ class FakeLoginDisplayHost : public LoginDisplayHost {
void ResyncUserData() override;
void ShowFeedback() override;
void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override;
void ShowDialogForCaptivePortal() override;
void HideDialogForCaptivePortal() override;
void UpdateAddUserButtonStatus() override;
......
......@@ -197,6 +197,9 @@ class LoginDisplayHost {
// Shows the powerwash dialog.
virtual void ShowResetScreen() = 0;
// Start up the help application for trouble signin in.
virtual void ShowAccountAccessHelpApp() = 0;
// In the views case, make the OobeUIDialogDelegate visible so that Captive
// Portal web modal can be seen. In webui login, this should be a no-op.
virtual void ShowDialogForCaptivePortal() = 0;
......
......@@ -317,6 +317,12 @@ void LoginDisplayHostMojo::ShowResetScreen() {
GetOobeUI()->ForwardAccelerator(kAccelReset);
}
void LoginDisplayHostMojo::ShowAccountAccessHelpApp() {
scoped_refptr<HelpAppLauncher>(new HelpAppLauncher(GetNativeWindow()))
->ShowHelpTopic(HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
dialog_->Show();
}
void LoginDisplayHostMojo::UpdateAddUserButtonStatus() {
DCHECK(GetOobeUI());
LoginScreenClient::Get()->login_screen()->SetAddUserButtonEnabled(
......
......@@ -93,6 +93,7 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon,
void OnCancelPasswordChangedFlow() override;
void ShowFeedback() override;
void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override;
void ShowDialogForCaptivePortal() override;
void HideDialogForCaptivePortal() override;
void UpdateAddUserButtonStatus() override;
......
......@@ -1177,6 +1177,10 @@ void LoginDisplayHostWebUI::ShowResetScreen() {
NOTREACHED();
}
void LoginDisplayHostWebUI::ShowAccountAccessHelpApp() {
NOTREACHED();
}
// This is handled differently in webui.
void LoginDisplayHostWebUI::ShowDialogForCaptivePortal() {}
......
......@@ -81,6 +81,7 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
const user_manager::UserList GetUsers() override;
void ShowFeedback() override;
void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override;
void ShowDialogForCaptivePortal() override;
void HideDialogForCaptivePortal() override;
void UpdateAddUserButtonStatus() override;
......
......@@ -73,6 +73,7 @@ class MockLoginDisplayHost : public LoginDisplayHost {
MOCK_METHOD0(ResyncUserData, void());
MOCK_METHOD0(ShowFeedback, void());
MOCK_METHOD0(ShowResetScreen, void());
MOCK_METHOD0(ShowAccountAccessHelpApp, void());
MOCK_METHOD0(OnCancelPasswordChangedFlow, void());
MOCK_METHOD0(ShowDialogForCaptivePortal, void());
MOCK_METHOD0(HideDialogForCaptivePortal, void());
......
......@@ -166,6 +166,10 @@ void LoginScreenClient::ShowResetScreen() {
chromeos::LoginDisplayHost::default_host()->ShowResetScreen();
}
void LoginScreenClient::ShowAccountAccessHelpApp() {
chromeos::LoginDisplayHost::default_host()->ShowAccountAccessHelpApp();
}
void LoginScreenClient::LoadWallpaper(const AccountId& account_id) {
WallpaperControllerClient::Get()->ShowUserWallpaper(account_id);
}
......
......@@ -86,6 +86,7 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
void LaunchKioskApp(const std::string& app_id) override;
void LaunchArcKioskApp(const AccountId& account_id) override;
void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override;
private:
void SetPublicSessionKeyboardLayout(
......
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