Commit 6afa58bd authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Fix dark mode detection in PasswordPendingView

Following discussion in crrev.com/c/1991710 about using dark mode PNGs,
the preferred approach is using color_utils::IsDark() instead of
GetNativeTheme()->ShouldUseDarkColors().

Change-Id: I50dceb05c8c902d148827b37914addf4e213c4d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019802
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735072}
parent da039b8d
......@@ -28,6 +28,7 @@
#include "ui/base/models/combobox_model_observer.h"
#include "ui/base/models/simple_combobox_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/image_button.h"
......@@ -422,7 +423,7 @@ void PasswordPendingView::AddedToWidget() {
void PasswordPendingView::OnThemeChanged() {
if (int id = model()->GetTopIllustration(
GetNativeTheme()->ShouldUseDarkColors())) {
color_utils::IsDark(GetBubbleFrameView()->GetBackgroundColor()))) {
GetBubbleFrameView()->SetHeaderView(CreateHeaderImage(id));
}
}
......
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