Skip to content

Commit

Permalink
Views: Add rounded corners support to NativeViewHostMac
Browse files Browse the repository at this point in the history
This change will enable WebUI bubbles used in top chrome to conform
to the secondary UI spec on Mac platforms.

Before:
https://drive.google.com/file/d/12gCfewhEQrzLAPL2IkCYZy7P_NJNp_jp/view?usp=sharing

After:
https://drive.google.com/file/d/1mkz37-Vmpy6a8HGfvg_JMMiJXdirWtEn/view?usp=sharing

Bug: 1156290
Change-Id: I06b3ef9090cfb8f08c0e9ba095bdeb9807ba107d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577939
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834824}
  • Loading branch information
Thomas Lukaszewicz authored and Chromium LUCI CQ committed Dec 8, 2020
1 parent 061b1e5 commit 1201068
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/views/controls/native/native_view_host_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ void EnsureNativeViewHasNoChildWidgets(NSView* native_view) {

bool NativeViewHostMac::SetCornerRadii(
const gfx::RoundedCornersF& corner_radii) {
NOTIMPLEMENTED();
return false;
ui::Layer* layer = GetUiLayer();
DCHECK(layer);
layer->SetRoundedCornerRadius(corner_radii);
layer->SetIsFastRoundedCorner(true);
return true;
}

bool NativeViewHostMac::SetCustomMask(std::unique_ptr<ui::LayerOwner> mask) {
Expand Down

0 comments on commit 1201068

Please sign in to comment.