mash: Convert SystemTrayDelegate::IsSearchKeyMappedToCapsLock to use prefs service |
|||||||
Issue descriptionIt just reads a pref in chrome and reports the value to the system tray menu. https://cs.chromium.org/chromium/src/ash/common/system/chromeos/tray_caps_lock.cc?type=cs&sq=package:chromium&rcl=1479154617&l=83 https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc?type=cs&sq=package:chromium&rcl=1479214462&l=592 https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc?type=cs&sq=package:chromium&rcl=1479214462&l=656
,
Mar 30 2017
The only tricky bit is that the pref might change when the active user is switched (for multiprofile). You can see this by logging in two users and only setting Keyboard Settings > Search Key > Caps Lock for one of them. When manually testing you'll need to turn off caps lock by pressing shift after switching users, because search will get remapped to app list on the switch but caps lock will stay on. :-) See SystemTrayDelegateChromeOS::SetProfile() for details. We might need some sort of SessionController / SessionStateObserver to watch for changes and poke the prefs service.
,
Jun 29 2017
We might have the prefs service switching now, see ash::Shell::GetActiveUserPrefService(). +yhanada because this might affect access to InputMethodManager in ash, which I think is used by the rest of this caps-lock feature.
,
Jul 4 2017
Thank you for letting me know.
,
Aug 3 2017
I'll take this. I just did a similar system tray item using prefs.
,
Aug 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92 commit 9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92 Author: James Cook <jamescook@chromium.org> Date: Mon Aug 07 18:00:07 2017 cros: Migrate system tray caps lock prefs code into ash The caps lock system tray menu item changes its labels based on whether the search key is remapped to caps lock. This was implemented with an in-process delegate back to chrome browser, but we can't do that in mash. Migrate the preference reading code into //ash and eliminate the SystemTrayDelegate method. Add a simple test for TrayCapsLock. Clean up some unnecessary includes. Bug: 665569 Test: ash_unittests, system tray item has correct label when search key is mapped to caps lock in settings Change-Id: I3a06049f713f41941a72b0a9384c280e6d9224ae Reviewed-on: https://chromium-review.googlesource.com/602501 Commit-Queue: James Cook <jamescook@chromium.org> Reviewed-by: Michael Wasserman <msw@chromium.org> Cr-Commit-Position: refs/heads/master@{#492358} [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/BUILD.gn [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/shell.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/shell.h [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray/system_tray.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray/system_tray.h [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray/system_tray_delegate.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray/system_tray_delegate.h [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray/system_tray_test_api.h [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray_caps_lock.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray_caps_lock.h [add] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/ash/system/tray_caps_lock_unittest.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/chrome/browser/chromeos/preferences.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc [modify] https://crrev.com/9807235c73e7b63ad4c8ef9a8d26d1ef2df98c92/chrome/browser/ui/ash/system_tray_delegate_chromeos.h
,
Aug 7 2017
,
Jan 22 2018
,
Feb 26 2018
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by jonr...@chromium.org
, Mar 30 2017Owner: jonr...@chromium.org