Commit 3cb3a098 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Drop set_owned_by_client From NotificationViewMD

NotificationControlButtonsView is added to a NotificationHeaderView
which is then added to the NotificationViewMD.

This means NotificationViewMD maintains the lifetime of
NotificationControlButtonsView as long as it doesn't remove the
NotificationControlButtonsView as a child.

BUG=1044687

Change-Id: Ic1b24832f7a26573a621604a56f5441c982b685a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202534
Commit-Queue: Tim Song <tengs@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Auto-Submit: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770061}
parent a39269fa
...@@ -586,13 +586,10 @@ NotificationViewMD::NotificationViewMD(const Notification& notification) ...@@ -586,13 +586,10 @@ NotificationViewMD::NotificationViewMD(const Notification& notification)
AddChildView(ink_drop_container_); AddChildView(ink_drop_container_);
control_buttons_view_ =
std::make_unique<NotificationControlButtonsView>(this);
control_buttons_view_->set_owned_by_client();
// |header_row_| contains app_icon, app_name, control buttons, etc... // |header_row_| contains app_icon, app_name, control buttons, etc...
header_row_ = new NotificationHeaderView(this); header_row_ = new NotificationHeaderView(this);
header_row_->AddChildView(control_buttons_view_.get()); control_buttons_view_ = header_row_->AddChildView(
std::make_unique<NotificationControlButtonsView>(this));
AddChildView(header_row_); AddChildView(header_row_);
// |content_row_| contains title, message, image, progressbar, etc... // |content_row_| contains title, message, image, progressbar, etc...
...@@ -1395,7 +1392,7 @@ void NotificationViewMD::UpdateCornerRadius(int top_radius, int bottom_radius) { ...@@ -1395,7 +1392,7 @@ void NotificationViewMD::UpdateCornerRadius(int top_radius, int bottom_radius) {
NotificationControlButtonsView* NotificationViewMD::GetControlButtonsView() NotificationControlButtonsView* NotificationViewMD::GetControlButtonsView()
const { const {
return control_buttons_view_.get(); return control_buttons_view_;
} }
bool NotificationViewMD::IsExpanded() const { bool NotificationViewMD::IsExpanded() const {
......
...@@ -276,7 +276,7 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -276,7 +276,7 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
views::InkDropContainerView* const ink_drop_container_; views::InkDropContainerView* const ink_drop_container_;
// View containing close and settings buttons // View containing close and settings buttons
std::unique_ptr<NotificationControlButtonsView> control_buttons_view_; NotificationControlButtonsView* control_buttons_view_;
// Whether this notification is expanded or not. // Whether this notification is expanded or not.
bool expanded_ = false; bool expanded_ = false;
......
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