Commit c23e9f44 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Update settings search page for secondary user

Check whether the user is primary when setup the search page in CrOS
settings. Remove the voice interaction entry and change the title if the
user is not primary.

BUG=b/66919596

Change-Id: I1b38de178830862ebca9c56160ddab595640c844
Reviewed-on: https://chromium-review.googlesource.com/689965Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505232}
parent fae86d4e
...@@ -1602,12 +1602,18 @@ void AddSearchInSettingsStrings(content::WebUIDataSource* html_source) { ...@@ -1602,12 +1602,18 @@ void AddSearchInSettingsStrings(content::WebUIDataSource* html_source) {
} }
void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) { void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
#if defined(OS_CHROMEOS)
const bool is_user_primary =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile) ==
user_manager::UserManager::Get()->GetPrimaryUser();
#endif
LocalizedString localized_strings[] = { LocalizedString localized_strings[] = {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
{"searchPageTitle", {"searchPageTitle", !profile->IsSupervised() && is_user_primary &&
!profile->IsSupervised() && chromeos::switches::IsVoiceInteractionEnabled() chromeos::switches::IsVoiceInteractionEnabled()
? IDS_SETTINGS_SEARCH_AND_ASSISTANT ? IDS_SETTINGS_SEARCH_AND_ASSISTANT
: IDS_SETTINGS_SEARCH}, : IDS_SETTINGS_SEARCH},
#else #else
{"searchPageTitle", IDS_SETTINGS_SEARCH}, {"searchPageTitle", IDS_SETTINGS_SEARCH},
#endif #endif
...@@ -1644,8 +1650,9 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -1644,8 +1650,9 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
base::ASCIIToUTF16(chrome::kOmniboxLearnMoreURL)); base::ASCIIToUTF16(chrome::kOmniboxLearnMoreURL));
html_source->AddString("searchExplanation", search_explanation_text); html_source->AddString("searchExplanation", search_explanation_text);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
html_source->AddBoolean("enableVoiceInteraction", html_source->AddBoolean(
chromeos::switches::IsVoiceInteractionEnabled()); "enableVoiceInteraction",
chromeos::switches::IsVoiceInteractionEnabled() && is_user_primary);
#endif #endif
} }
......
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