New issue
Advanced search Search tips

Issue 665569 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 622347

Blocking:
issue 738210



Sign in to add a comment

mash: Convert SystemTrayDelegate::IsSearchKeyMappedToCapsLock to use prefs service

Project Member Reported by jamescook@chromium.org, Nov 15 2016

Issue description

Cc: jamescook@chromium.org
Owner: jonr...@chromium.org
Components: -MUS Internals>MUS
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.

Blocking: 738210
Cc: -jonr...@chromium.org yhanada@chromium.org
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.

Thank you for letting me know.
Cc: -jamescook@chromium.org jonr...@chromium.org
Owner: jamescook@chromium.org
Status: Started (was: Assigned)
I'll take this. I just did a similar system tray item using prefs.

Project Member

Comment 6 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)

Comment 8 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)
Components: -Internals>MUS Internals>Services>WindowService

Sign in to add a comment