Commit 7fef27e9 authored by Aga Wronska's avatar Aga Wronska Committed by Commit Bot

Open help app when 'Need help' button is pressed on parent access dialog

Help app will present help topic about parent access code:
https://support.google.com/families/answer/7307262
This change requires submitting new offline resources to
chromeos-assets (WIP).

Bug: 941702
Test: ParentAccessViewTest + manually
Change-Id: Ib7d9846e1e8bc4da3ce3ebb803a5d621994699d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764750Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarHenrique Grandinetti <hgrandinetti@chromium.org>
Commit-Queue: Aga Wronska <agawronska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689537}
parent 25d111bb
...@@ -449,6 +449,10 @@ void LoginScreenController::ShowAccountAccessHelpApp() { ...@@ -449,6 +449,10 @@ void LoginScreenController::ShowAccountAccessHelpApp() {
client_->ShowAccountAccessHelpApp(); client_->ShowAccountAccessHelpApp();
} }
void LoginScreenController::ShowParentAccessHelpApp() {
client_->ShowParentAccessHelpApp();
}
void LoginScreenController::ShowLockScreenNotificationSettings() { void LoginScreenController::ShowLockScreenNotificationSettings() {
client_->ShowLockScreenNotificationSettings(); client_->ShowLockScreenNotificationSettings();
} }
......
...@@ -97,6 +97,7 @@ class ASH_EXPORT LoginScreenController : public LoginScreen, ...@@ -97,6 +97,7 @@ class ASH_EXPORT LoginScreenController : public LoginScreen,
void ShowFeedback(); void ShowFeedback();
void ShowResetScreen(); void ShowResetScreen();
void ShowAccountAccessHelpApp(); void ShowAccountAccessHelpApp();
void ShowParentAccessHelpApp();
void ShowLockScreenNotificationSettings(); void ShowLockScreenNotificationSettings();
void FocusOobeDialog(); void FocusOobeDialog();
void NotifyUserActivity(); void NotifyUserActivity();
......
...@@ -120,6 +120,7 @@ class MockLoginScreenClient : public LoginScreenClient { ...@@ -120,6 +120,7 @@ class MockLoginScreenClient : public LoginScreenClient {
MOCK_METHOD(void, ShowFeedback, (), (override)); MOCK_METHOD(void, ShowFeedback, (), (override));
MOCK_METHOD(void, ShowResetScreen, (), (override)); MOCK_METHOD(void, ShowResetScreen, (), (override));
MOCK_METHOD(void, ShowAccountAccessHelpApp, (), (override)); MOCK_METHOD(void, ShowAccountAccessHelpApp, (), (override));
MOCK_METHOD(void, ShowParentAccessHelpApp, (), (override));
MOCK_METHOD(void, ShowLockScreenNotificationSettings, (), (override)); MOCK_METHOD(void, ShowLockScreenNotificationSettings, (), (override));
MOCK_METHOD(void, FocusOobeDialog, (), (override)); MOCK_METHOD(void, FocusOobeDialog, (), (override));
MOCK_METHOD(void, OnFocusLeavingSystemTray, (bool reverse), (override)); MOCK_METHOD(void, OnFocusLeavingSystemTray, (bool reverse), (override));
......
...@@ -542,7 +542,6 @@ ParentAccessView::ParentAccessView(const AccountId& account_id, ...@@ -542,7 +542,6 @@ ParentAccessView::ParentAccessView(const AccountId& account_id,
add_spacer(kTitleToDescriptionDistanceDp); add_spacer(kTitleToDescriptionDistanceDp);
// Main view description. // Main view description.
// TODO(crbug.com/970223): Add learn more link after description.
description_label_ = new views::Label(GetDescription(request_reason_), description_label_ = new views::Label(GetDescription(request_reason_),
views::style::CONTEXT_LABEL, views::style::CONTEXT_LABEL,
views::style::STYLE_PRIMARY); views::style::STYLE_PRIMARY);
...@@ -684,8 +683,7 @@ void ParentAccessView::ButtonPressed(views::Button* sender, ...@@ -684,8 +683,7 @@ void ParentAccessView::ButtonPressed(views::Button* sender,
if (sender == back_button_) { if (sender == back_button_) {
callbacks_.on_finished.Run(false); callbacks_.on_finished.Run(false);
} else if (sender == help_button_) { } else if (sender == help_button_) {
// TODO(agawronska): Implement help view. Shell::Get()->login_screen_controller()->ShowParentAccessHelpApp();
NOTIMPLEMENTED();
} else if (sender == submit_button_) { } else if (sender == submit_button_) {
SubmitCode(); SubmitCode();
} }
......
...@@ -176,6 +176,18 @@ TEST_F(ParentAccessViewTest, SubmitButton) { ...@@ -176,6 +176,18 @@ TEST_F(ParentAccessViewTest, SubmitButton) {
EXPECT_EQ(1, successful_validation_); EXPECT_EQ(1, successful_validation_);
} }
// Tests that help button opens help app.
TEST_F(ParentAccessViewTest, HelpButton) {
auto client = std::make_unique<MockLoginScreenClient>();
StartView();
ParentAccessView::TestApi test_api(view_);
EXPECT_TRUE(test_api.help_button()->GetEnabled());
EXPECT_CALL(*client, ShowParentAccessHelpApp()).Times(1);
SimulateButtonPress(test_api.help_button());
}
// Tests that access code can be entered with numpad. // Tests that access code can be entered with numpad.
TEST_F(ParentAccessViewTest, Numpad) { TEST_F(ParentAccessViewTest, Numpad) {
StartView(); StartView();
......
...@@ -150,6 +150,9 @@ class ASH_PUBLIC_EXPORT LoginScreenClient { ...@@ -150,6 +150,9 @@ class ASH_PUBLIC_EXPORT LoginScreenClient {
// Show the help app for when users have trouble signing in to their account. // Show the help app for when users have trouble signing in to their account.
virtual void ShowAccountAccessHelpApp() = 0; virtual void ShowAccountAccessHelpApp() = 0;
// Shows help app for users that have trouble using parent access code.
virtual void ShowParentAccessHelpApp() = 0;
// Show the lockscreen notification settings page. // Show the lockscreen notification settings page.
virtual void ShowLockScreenNotificationSettings() = 0; virtual void ShowLockScreenNotificationSettings() = 0;
......
...@@ -40,6 +40,8 @@ class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> { ...@@ -40,6 +40,8 @@ class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> {
HELP_WILCO_BATTERY_CHARGER = 9383188, HELP_WILCO_BATTERY_CHARGER = 9383188,
// Shown as "Learn more" for Wilco notifications related to dock station. // Shown as "Learn more" for Wilco notifications related to dock station.
HELP_WILCO_DOCK = 9385025, HELP_WILCO_DOCK = 9385025,
// Shown under "Need help?" button on parent access dialog.
HELP_PARENT_ACCESS_CODE = 7307262,
}; };
// The dialog is shown as a child of |parent_window|. If |parent_window| is // The dialog is shown as a child of |parent_window|. If |parent_window| is
......
...@@ -233,6 +233,12 @@ void LoginScreenClient::ShowAccountAccessHelpApp() { ...@@ -233,6 +233,12 @@ void LoginScreenClient::ShowAccountAccessHelpApp() {
->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); ->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
} }
void LoginScreenClient::ShowParentAccessHelpApp() {
scoped_refptr<chromeos::HelpAppLauncher>(
new chromeos::HelpAppLauncher(nullptr))
->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_PARENT_ACCESS_CODE);
}
void LoginScreenClient::ShowLockScreenNotificationSettings() { void LoginScreenClient::ShowLockScreenNotificationSettings() {
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings( chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
ProfileManager::GetActiveUserProfile(), chrome::kLockScreenSubPage); ProfileManager::GetActiveUserProfile(), chrome::kLockScreenSubPage);
......
...@@ -117,6 +117,7 @@ class LoginScreenClient : public ash::LoginScreenClient { ...@@ -117,6 +117,7 @@ class LoginScreenClient : public ash::LoginScreenClient {
void ShowFeedback() override; void ShowFeedback() override;
void ShowResetScreen() override; void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override; void ShowAccountAccessHelpApp() override;
void ShowParentAccessHelpApp() override;
void ShowLockScreenNotificationSettings() override; void ShowLockScreenNotificationSettings() override;
void OnFocusLeavingSystemTray(bool reverse) override; void OnFocusLeavingSystemTray(bool reverse) override;
void OnUserActivity() override; void OnUserActivity() override;
......
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