0

[ios] Improve hover effect of fakebox (ntp)

This CL fixes the hover effect of the fake ntp to match the shape of
the search box.
There is no visible change on iPad.
A screenshot of the new behavior can be found in the bug page.

Bug: 41495066
Change-Id: I98c2b1757989f1fdf562cc0f4d1de89521facfb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5268548
Commit-Queue: Federica Germinario <fedegermi@google.com>
Reviewed-by: Asami Doi <asamidoi@chromium.org>
Reviewed-by: Scott Yoder <scottyoder@google.com>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257257}
This commit is contained in:
Federica Germinario
2024-02-07 09:51:27 +00:00
committed by Chromium LUCI CQ
parent 58d32fa4f3
commit 5bf44b390e

@ -53,6 +53,9 @@ namespace {
NSString* const kScribbleFakeboxElementId = @"fakebox";
// Height margin of the fake location bar.
const CGFloat kFakeLocationBarHeightMargin = 2;
} // namespace
@interface NewTabPageHeaderViewController () <
@ -343,6 +346,11 @@ NSString* const kScribbleFakeboxElementId = @"fakebox";
forKeyPath:@"highlighted"
options:NSKeyValueObservingOptionNew
context:NULL];
CGFloat fakeOmniboxHeight = content_suggestions::FakeOmniboxHeight();
self.accessibilityButton.layer.cornerRadius =
(fakeOmniboxHeight - kFakeLocationBarHeightMargin) / 2;
self.accessibilityButton.clipsToBounds = YES;
self.accessibilityButton.isAccessibilityElement = YES;
self.accessibilityButton.accessibilityLabel =
l10n_util::GetNSString(IDS_OMNIBOX_EMPTY_HINT);