Skip to content

Commit

Permalink
rgbkbd: show nudge only if device is supported
Browse files Browse the repository at this point in the history
Fix a bug where the nudge was shown incorrectly for the devices that do
not have rgb capability.

BUG=b/243435252
TEST=Manually

Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Change-Id: I9af89f66a00a0933bb66240e579076f9cfa181da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3848706
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Jason Thai <jasontt@chromium.org>
Auto-Submit: Jason Thai <jasontt@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Quick-Run: Jason Thai <jasontt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1038027}
  • Loading branch information
Jason Thai authored and Chromium LUCI CQ committed Aug 22, 2022
1 parent e3d1cd1 commit 747e99b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ash/system/unified/unified_slider_bubble_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "ash/bubble/bubble_constants.h"
#include "ash/constants/ash_features.h"
#include "ash/rgb_keyboard/rgb_keyboard_manager.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shelf/shelf.h"
Expand Down Expand Up @@ -122,7 +123,8 @@ void UnifiedSliderBubbleController::OnKeyboardBrightnessChanged(
// User has made a brightness adjustment, or the KBL was made
// no-longer-forced-off implicitly in response to a user adjustment.
ShowBubble(SLIDER_TYPE_KEYBOARD_BRIGHTNESS);
if (features::IsRgbKeyboardEnabled()) {
if (features::IsRgbKeyboardEnabled() &&
Shell::Get()->rgb_keyboard_manager()->IsRgbKeyboardSupported()) {
// Show the education nudge to change the keyboard backlight color if
// applicable. |bubble_view_| is used as the anchor view.
Shell::Get()
Expand Down

0 comments on commit 747e99b

Please sign in to comment.