New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 841301 link

Starred by 7 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 23
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Allow limiting available keyboard layouts within user sessions.

Project Member Reported by hendrich@chromium.org, May 9 2018

Issue description

broken out from  crbug.com/695042 

Description:
Allow limiting available keyboard layouts within user sessions.

Use case:
Admins would set a list of allowed keyboard layouts. Users can then only chose one of the specified keyboard layouts.

Motivation:
Prevent users from switching their keyboard layouts to undesired values.

 
Any timetable on this being addressed?
Cc: naveenv@chromium.org
Should probably be finished within this month, depending on how much other projects/bugs come up

Comment 4 by dskaram@google.com, May 11 2018

Cc: -dskaram@chromium.org
This Cl: https://chromium-review.googlesource.com/c/chromium/src/+/1086998 does not show any  user notification about list of input methods change.

Could we add notification?
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4c3953cffc62bb3e53acc691770a1f58df1d8f5

commit a4c3953cffc62bb3e53acc691770a1f58df1d8f5
Author: Alexander Hendrich <hendrich@chromium.org>
Date: Wed Jun 27 08:33:05 2018

Add 'AllowedInputMethods' policy

Added a policy to limit the user's choices for their input methods in a
user session. The user can only select one of the provided input
methods in the list. If the current user's input method is not allowed,
the user's input method will be set to the hardware keyboard layout (if
allowed) or the first valid entry in this list.

Bug:  841301 
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: If68d812fa8b9621c776acff4e218b0002d038081
Reviewed-on: https://chromium-review.googlesource.com/1086998
Commit-Queue: Alexander Hendrich <hendrich@chromium.org>
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Shu Chen <shuchen@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570696}
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/app/settings_strings.grdp
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/input_method/input_method_manager_impl.h
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/login/lock_screen_utils.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/preferences.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/chromeos/preferences.h
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/extensions/api/settings_private/prefs_util.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/policy/configuration_policy_handler_list_factory.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/internet_page/internet_page.html
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/languages_page/languages.js
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/languages_page/languages_page.html
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/languages_page/manage_input_methods_page.html
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/languages_page/manage_input_methods_page.js
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/resources/settings/settings_shared_css.html
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/common/extensions/api/language_settings_private.idl
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/common/pref_names.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/common/pref_names.h
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/chrome/test/data/policy/policy_test_cases.json
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/components/policy/resources/policy_templates.json
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/third_party/closure_compiler/externs/language_settings_private.js
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/tools/metrics/histograms/enums.xml
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/ui/base/ime/chromeos/input_method_manager.h
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/ui/base/ime/chromeos/mock_input_method_manager.cc
[modify] https://crrev.com/a4c3953cffc62bb3e53acc691770a1f58df1d8f5/ui/base/ime/chromeos/mock_input_method_manager.h

Status: Fixed (was: Assigned)
Checked the issue using Yaps on 
Google Chrome: 69.0.3480.0 (Official Build) dev (32-bit)
Platform: 10863.0.0 (Official Build) dev-channel kevin

Yaps settings: 
AllowedInputMethods -> te,en_US
AllowedUILocales -> te,en_US

Observation:
Before signing into the session, 
1. Different multiple languages are listed. 
2. English keyboard layouts are listed.

Expected: 
te and en_US language and keyboard layouts should only be shown.

Attached screenshots. Could you please take a look.  
Screenshot 2018-07-10 at 4.56.30 PM.png
668 KB View Download
Screenshot 2018-07-10 at 4.57.22 PM.png
627 KB View Download
Screenshot 2018-07-10 at 4.57.43 PM.png
634 KB View Download
Screenshot 2018-07-10 at 4.57.59 PM.png
626 KB View Download
Both of these policies are only enforced within a user session. For the login screen we already have 'DeviceLoginScreenLocales' and 'DeviceLoginScreenInputMethods'.

For the UI locales you should use "en-US" instead of "en_US".
For the input methods you should use something like "xkb:us::eng" instead of "en_US". I couldn't find a matching input method identifier for "te" (see go/crosregions).

Thanks Hendrich, 

Re-checked on 

Google Chrome: 69.0.3486.0 (Official Build) dev (32-bit)
Platform: 10866.1.0 (Official Build) dev-channel kevin
Firmware: Google_Kevin.8785.264.0

Observation:
1. AllowedInputMethods Policy is loaded.

2. Forced keyboards (xkb:de::ger,xkb:us::eng) are seen in settings and able switch between them.

3. When user adds a language (telugu) via chrome settings, able to enable new keyboard.(which is not forced as per policy)

Attached screenshots. Please take a look. Thanks.!   
Screenshot 2018-07-13 at 3.00.43 PM.png
200 KB View Download
Screenshot 2018-07-13 at 3.00.56 PM.png
201 KB View Download
Screenshot 2018-07-13 at 3.02.10 PM.png
198 KB View Download
Status: Assigned (was: Fixed)
Hi Hendrich

When user adds a language (telugu) via chrome settings, able to enable new keyboard.(which is not forced as per policy)

is this intended.? Please confirm.
No, this is not intended, I will have a look at it on monday. Thank you for spotting that bug.
Status: Fixed (was: Assigned)
Hey chchakrapani,

I just reproduced your bug description. When adding "Telugu" as a language, the input method "Telugu keyboard (Phonetic)" is indeed available, even if the policy only allows certain other layouts (e.g. xkb:us::eng). However, the telugu keyboard is not an actual keyboard layout (https://cs.chromium.org/chromium/src/chrome/browser/chromeos/input_method/input_method_manager_impl.cc?sq=package:chromium&g=0&l=484). Therefore, it is allowed anyways. The policy only restricts actual keyboard layouts.
So this behavior is indeed intended. Maybe the policy name "AllowedInputMethods" should have been "AllowedKeyboardLayouts" instead, but I tried to keep it consistent with the similar "login_screen_input_methods" policy.


I also reproduced this for actual keyboard layouts (set policy to "xkb:us::eng" and add "French" language). In this case the french keyboard layouts are all restricted (as intended).
Status: Verified (was: Fixed)
Thanks.! Hendrich for mentioning the details,
Closing the bug as verified as per your confirmation.

Sign in to add a comment