Commit 7c4d25d6 authored by Henrique Santos's avatar Henrique Santos Committed by Commit Bot

Enable Assistant for child accounts.

This reverts commit 71f820a1 ("Disable assistant for child account").

Bug: b:120075638
Test: built and tested locally
Change-Id: I59d3d4869ba596fa462a904b8a64a88230c28325
Reviewed-on: https://chromium-review.googlesource.com/c/1351155
Commit-Queue: Henrique Nazaré Santos <nazare@google.com>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613206}
parent f30f559a
...@@ -709,7 +709,6 @@ void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) { ...@@ -709,7 +709,6 @@ void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) {
case mojom::AssistantAllowedState::DISALLOWED_BY_ARC_DISALLOWED: case mojom::AssistantAllowedState::DISALLOWED_BY_ARC_DISALLOWED:
case mojom::AssistantAllowedState::DISALLOWED_BY_FLAG: case mojom::AssistantAllowedState::DISALLOWED_BY_FLAG:
case mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER: case mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER:
case mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER:
case mojom::AssistantAllowedState::DISALLOWED_BY_INCOGNITO: case mojom::AssistantAllowedState::DISALLOWED_BY_INCOGNITO:
// TODO(xiaohuic): show a specific toast. // TODO(xiaohuic): show a specific toast.
return; return;
......
...@@ -39,8 +39,6 @@ enum AssistantAllowedState { ...@@ -39,8 +39,6 @@ enum AssistantAllowedState {
DISALLOWED_BY_NONPRIMARY_USER, DISALLOWED_BY_NONPRIMARY_USER,
// Disallowed because current user is supervised user. // Disallowed because current user is supervised user.
DISALLOWED_BY_SUPERVISED_USER, DISALLOWED_BY_SUPERVISED_USER,
// Disallowed because current user is child user.
DISALLOWED_BY_CHILD_USER,
// Disallowed because incognito mode. // Disallowed because incognito mode.
DISALLOWED_BY_INCOGNITO, DISALLOWED_BY_INCOGNITO,
// Disallowed because the device is in demo mode. // Disallowed because the device is in demo mode.
......
...@@ -627,9 +627,6 @@ ash::mojom::AssistantAllowedState IsAssistantAllowedForProfile( ...@@ -627,9 +627,6 @@ ash::mojom::AssistantAllowedState IsAssistantAllowedForProfile(
if (profile->IsLegacySupervised()) if (profile->IsLegacySupervised())
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER; return ash::mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER;
if (profile->IsChild())
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER;
if (chromeos::switches::IsVoiceInteractionFlagsEnabled()) { if (chromeos::switches::IsVoiceInteractionFlagsEnabled()) {
if (!chromeos::switches::IsVoiceInteractionLocalesSupported()) if (!chromeos::switches::IsVoiceInteractionLocalesSupported())
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_LOCALE; return ash::mojom::AssistantAllowedState::DISALLOWED_BY_LOCALE;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h" #include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/supervised_user/supervised_user_constants.h"
#include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h" #include "chrome/test/base/testing_profile_manager.h"
...@@ -544,18 +543,6 @@ TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_SupervisedUser) { ...@@ -544,18 +543,6 @@ TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_SupervisedUser) {
IsAssistantAllowedForProfile(profile())); IsAssistantAllowedForProfile(profile()));
} }
TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_ChildUser) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--arc-availability=officially-supported",
"--enable-voice-interaction"});
ScopedLogIn login(GetFakeUserManager(),
AccountId::FromUserEmailGaiaId(
profile()->GetProfileUserName(), kTestGaiaId));
profile()->SetSupervisedUserId(supervised_users::kChildAccountSUID);
EXPECT_EQ(ash::mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER,
IsAssistantAllowedForProfile(profile()));
}
TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_Locale) { TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_Locale) {
base::CommandLine::ForCurrentProcess()->InitFromArgv( base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--arc-availability=officially-supported", {"", "--arc-availability=officially-supported",
......
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