Commit 98ae27b7 authored by Yeol's avatar Yeol Committed by Commit Bot

FootnoteContainerView::FootnoteContainerView take std::unique_ptr<View>.

FootnoteContainerView::FootnoteContainerView() should take
an std::unique_ptr<View> to better convey ownership transfers.

Bug: 973845
Change-Id: Iaea1c9f0b9b054a0133c36f461dbced03ef2aaa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670573Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Yeol Park <peary2@gmail.com>
Cr-Commit-Position: refs/heads/master@{#671522}
parent 85826690
......@@ -456,7 +456,7 @@ void BubbleFrameView::SetFootnoteView(std::unique_ptr<View> view) {
DCHECK(!footnote_container_);
int radius = bubble_border_ ? bubble_border_->corner_radius() : 0;
footnote_container_ = AddChildView(std::make_unique<FootnoteContainerView>(
footnote_margins_, view.release(), radius));
footnote_margins_, std::move(view), radius));
}
void BubbleFrameView::SetCornerRadius(int radius) {
......
......@@ -49,7 +49,7 @@ class HalfRoundedRectBackground : public Background {
} // namespace
FootnoteContainerView::FootnoteContainerView(const gfx::Insets& margins,
View* child_view,
std::unique_ptr<View> child_view,
float corner_radius) {
SetLayoutManager(
std::make_unique<BoxLayout>(BoxLayout::kVertical, margins, 0));
......@@ -58,8 +58,8 @@ FootnoteContainerView::FootnoteContainerView(const gfx::Insets& margins,
GetNativeTheme()->SystemDarkModeEnabled()
? gfx::kGoogleGrey900
: gfx::kGoogleGrey200));
AddChildView(child_view);
SetVisible(child_view->GetVisible());
auto* child_view_ptr = AddChildView(std::move(child_view));
SetVisible(child_view_ptr->GetVisible());
}
FootnoteContainerView::~FootnoteContainerView() = default;
......
......@@ -16,7 +16,7 @@ class FootnoteContainerView : public View {
METADATA_HEADER(FootnoteContainerView);
FootnoteContainerView(const gfx::Insets& margins,
View* child_view,
std::unique_ptr<View> child_view,
float corner_radius);
~FootnoteContainerView() override;
......
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