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