@@ -14,6 +14,7 @@ void NativeView::SetNativeView(NATIVEVIEW view) {
1414 if (delete_view_)
1515 delete view_;
1616 }
17+
1718 view_ = view;
1819 view_->AddObserver (this );
1920}
@@ -53,6 +54,13 @@ void NativeView::OnViewIsDeleting(views::View* observed_view) {
5354 NotifyViewIsDeleting ();
5455}
5556
57+ void NativeView::OnViewHierarchyChanged (
58+ views::View* observed_view,
59+ const views::ViewHierarchyChangedDetails& details) {
60+ SetRoundedCorners (GetRoundedCorners ());
61+ SetClickThrough (IsClickThrough ());
62+ }
63+
5664void NativeView::SetBounds (const gfx::Rect& bounds,
5765 const BoundsAnimationOptions& options) {
5866 if (view_)
@@ -124,7 +132,11 @@ void NativeView::SetBackgroundColor(SkColor color) {
124132
125133void NativeView::SetRoundedCorners (
126134 const NativeView::RoundedCornersOptions& options) {
135+ rounded_corners_ = options;
127136 auto * view = GetNative ();
137+ if (!view)
138+ return ;
139+
128140 view->SetPaintToLayer ();
129141 view->layer ()->SetFillsBoundsOpaquely (false );
130142
@@ -137,9 +149,21 @@ void NativeView::SetRoundedCorners(
137149 view->layer ()->SetIsFastRoundedCorner (true );
138150}
139151
152+ void NativeView::SetClickThrough (bool click_through) {
153+ is_click_through_ = click_through;
154+ auto * view = GetNative ();
155+ if (!view)
156+ return ;
157+
158+ view->SetCanProcessEventsWithinSubtree (!click_through);
159+ }
160+
140161void NativeView::SetClippingInsets (
141162 const NativeView::ClippingInsetOptions& options) {
142163 auto * view = GetNative ();
164+ if (!view)
165+ return ;
166+
143167 view->SetPaintToLayer ();
144168 view->layer ()->SetFillsBoundsOpaquely (false );
145169
0 commit comments