| Index: chrome/browser/ui/cocoa/tabs/tab_view.mm
|
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
|
| index 3804cfa6e64268254a1c1f0da9010bfc88d5640b..bb9175af9f5677a3e63c981354514038b24dce2a 100644
|
| --- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
|
| +++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
|
| @@ -4,6 +4,7 @@
|
|
|
| #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/i18n/rtl.h"
|
| #include "base/logging.h"
|
| #include "base/mac/sdk_forward_declarations.h"
|
| @@ -16,6 +17,7 @@
|
| #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
|
| #import "chrome/browser/ui/cocoa/themed_window.h"
|
| #import "chrome/browser/ui/cocoa/view_id_util.h"
|
| +#include "chrome/common/chrome_features.h"
|
| #include "chrome/grit/theme_resources.h"
|
| #include "skia/ext/skia_utils_mac.h"
|
| #import "third_party/google_toolbox_for_mac/src/AppKit/GTMFadeTruncatingTextFieldCell.h"
|
| @@ -33,6 +35,10 @@
|
| // The color of the icons in dark mode theme.
|
| const SkColor kDarkModeIconColor = SkColorSetARGB(0xFF, 0xC4, 0xC4, 0xC4);
|
|
|
| +bool IsTabStripKeyboardFocusEnabled() {
|
| + return base::FeatureList::IsEnabled(features::kTabStripKeyboardFocus);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // The amount of time in seconds during which each type of glow increases, holds
|
| @@ -789,6 +795,27 @@ - (void)windowDidChangeActive {
|
| [self setNeedsDisplay:YES];
|
| }
|
|
|
| +- (BOOL)acceptsFirstResponder {
|
| + return IsTabStripKeyboardFocusEnabled() ? YES : NO;
|
| +}
|
| +
|
| +- (BOOL)becomeFirstResponder {
|
| + return IsTabStripKeyboardFocusEnabled() ? YES : NO;
|
| +}
|
| +
|
| +- (void)drawFocusRingMask {
|
| + if (!IsTabStripKeyboardFocusEnabled())
|
| + return;
|
| + if ([titleView_ isHidden])
|
| + NSRectFill([self bounds]);
|
| + else
|
| + NSRectFill([titleView_ frame]);
|
| +}
|
| +
|
| +- (NSRect)focusRingMaskBounds {
|
| + return [self bounds];
|
| +}
|
| +
|
| @end // @implementation TabView
|
|
|
| @implementation TabView (TabControllerInterface)
|
|
|