Commit 75c4c9c0 authored by Ionel Popescu's avatar Ionel Popescu Committed by Commit Bot

Update focus ring color for increased contrast option on Mac.

Per the comment in [1], this CL updates the focus ring color
when increased contrast is enabled on Mac to #101010.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1054813#c22

Bug: 1054813
Change-Id: Iac10ec3a21bf920bd16744f7752d7a24a4aa1906
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094345Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Ionel Popescu <iopopesc@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#748483}
parent f2573197
specific_include_rules = { specific_include_rules = {
"layout_theme\.cc": [ "layout_theme\.cc|layout_theme_mac\.mm": [
"+ui/native_theme/native_theme.h", "+ui/native_theme/native_theme.h",
], ],
} }
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#import "third_party/blink/renderer/platform/runtime_enabled_features.h" #import "third_party/blink/renderer/platform/runtime_enabled_features.h"
#import "third_party/blink/renderer/platform/web_test_support.h" #import "third_party/blink/renderer/platform/web_test_support.h"
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
#include "ui/native_theme/native_theme.h"
// This is a view whose sole purpose is to tell AppKit that it's flipped. // This is a view whose sole purpose is to tell AppKit that it's flipped.
@interface BlinkFlippedControl : NSControl @interface BlinkFlippedControl : NSControl
...@@ -348,6 +349,11 @@ Color LayoutThemeMacRefresh::FocusRingColor() const { ...@@ -348,6 +349,11 @@ Color LayoutThemeMacRefresh::FocusRingColor() const {
: kDefaultFocusRingColor; : kDefaultFocusRingColor;
} }
if (ui::NativeTheme::GetInstanceForWeb()->UsesHighContrastColors()) {
// When high contrast is enabled, #101010 should be used.
return Color(0xFF101010);
}
// TODO(crbug.com/929098) Need to pass an appropriate color scheme here. // TODO(crbug.com/929098) Need to pass an appropriate color scheme here.
WebColorScheme color_scheme = ComputedStyle::InitialStyle().UsedColorScheme(); WebColorScheme color_scheme = ComputedStyle::InitialStyle().UsedColorScheme();
......
...@@ -894,6 +894,7 @@ _CONFIG = [ ...@@ -894,6 +894,7 @@ _CONFIG = [
{ {
'paths': [ 'paths': [
'third_party/blink/renderer/core/layout/layout_theme.cc', 'third_party/blink/renderer/core/layout/layout_theme.cc',
'third_party/blink/renderer/core/layout/layout_theme_mac.mm',
'third_party/blink/renderer/core/paint/fallback_theme.cc', 'third_party/blink/renderer/core/paint/fallback_theme.cc',
'third_party/blink/renderer/core/paint/fallback_theme.h', 'third_party/blink/renderer/core/paint/fallback_theme.h',
'third_party/blink/renderer/core/paint/object_painter_base.cc', 'third_party/blink/renderer/core/paint/object_painter_base.cc',
......
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