Commit 3c43055c authored by avi's avatar avi Committed by Commit bot

Remove stl_util's deletion function use from ui/message_center/.

BUG=555865

Review-Url: https://codereview.chromium.org/2440443005
Cr-Commit-Position: refs/heads/master@{#427102}
parent 072bc121
......@@ -185,8 +185,8 @@ void MessageListView::ResetRepositionSession() {
has_deferred_task_ = false;
// cancel cause OnBoundsAnimatorDone which deletes |deleted_when_done_|.
animator_.Cancel();
base::STLDeleteContainerPointers(deleting_views_.begin(),
deleting_views_.end());
for (auto view : deleting_views_)
delete view;
deleting_views_.clear();
adding_views_.clear();
}
......@@ -218,17 +218,16 @@ void MessageListView::ClearAllClosableNotifications(
void MessageListView::OnBoundsAnimatorProgressed(
views::BoundsAnimator* animator) {
DCHECK_EQ(&animator_, animator);
for (std::set<views::View*>::iterator iter = deleted_when_done_.begin();
iter != deleted_when_done_.end(); ++iter) {
const gfx::SlideAnimation* animation = animator->GetAnimationForView(*iter);
for (auto view : deleted_when_done_) {
const gfx::SlideAnimation* animation = animator->GetAnimationForView(view);
if (animation)
(*iter)->layer()->SetOpacity(animation->CurrentValueBetween(1.0, 0.0));
view->layer()->SetOpacity(animation->CurrentValueBetween(1.0, 0.0));
}
}
void MessageListView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) {
base::STLDeleteContainerPointers(deleted_when_done_.begin(),
deleted_when_done_.end());
for (auto view : deleted_when_done_)
delete view;
deleted_when_done_.clear();
if (clear_all_started_) {
......@@ -379,7 +378,7 @@ void MessageListView::AnimateNotificationsAboveTarget() {
}
// If the calculated length is changed from |repositon_top_|, it means that
// some of items above the targe are updated and their height are changed.
// some of items above the target are updated and their height are changed.
// Adjust the vertical length above the target.
if (reposition_top_ != vertical_gap_to_target_from_top) {
fixed_height_ -= reposition_top_ - vertical_gap_to_target_from_top;
......
......@@ -8,7 +8,6 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "components/url_formatter/elide_url.h"
......@@ -509,8 +508,8 @@ void NotificationView::CreateOrUpdateProgressBarView(
void NotificationView::CreateOrUpdateListItemViews(
const Notification& notification) {
for (size_t i = 0; i < item_views_.size(); ++i)
delete item_views_[i];
for (auto item_view : item_views_)
delete item_view;
item_views_.clear();
int padding = kMessageLineHeight - views::Label().font_list().GetHeight();
......@@ -590,9 +589,12 @@ void NotificationView::CreateOrUpdateActionButtonViews(
bool new_buttons = action_buttons_.size() != buttons.size();
if (new_buttons || buttons.size() == 0) {
// STLDeleteElements also clears the container.
base::STLDeleteElements(&separators_);
base::STLDeleteElements(&action_buttons_);
for (auto item : separators_)
delete item;
separators_.clear();
for (auto item : action_buttons_)
delete item;
action_buttons_.clear();
}
DCHECK(bottom_view_);
......
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