Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: ui/message_center/views/message_list_view.cc

Issue 2926793002: Use ContainsValue() instead of std::find() in ui/wm and ui/message_center (Closed)
Patch Set: Changed EXPECT_TRUE to EXPECT_FALSE Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/wm/core/shadow_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_list_view.cc
diff --git a/ui/message_center/views/message_list_view.cc b/ui/message_center/views/message_list_view.cc
index a5c77aab3c2bd015c98d8b3cdd72e17cfd505989..ed908fab5556861997db31e48e7a54d5bff618af 100644
--- a/ui/message_center/views/message_list_view.cc
+++ b/ui/message_center/views/message_list_view.cc
@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <algorithm>
+#include "ui/message_center/views/message_list_view.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/stl_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/message_center/message_center_style.h"
#include "ui/message_center/message_center_switches.h"
#include "ui/message_center/views/message_center_view.h"
-#include "ui/message_center/views/message_list_view.h"
#include "ui/message_center/views/message_view.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
@@ -104,8 +104,7 @@ void MessageListView::RemoveNotification(MessageView* view) {
// TODO(yhananda): We should consider consolidating clearing_all_views_,
// deleting_views_ and deleted_when_done_.
- if (std::find(clearing_all_views_.begin(), clearing_all_views_.end(), view) !=
- clearing_all_views_.end() ||
+ if (base::ContainsValue(clearing_all_views_, view) ||
deleting_views_.find(view) != deleting_views_.end() ||
deleted_when_done_.find(view) != deleted_when_done_.end()) {
// Let's skip deleting the view if it's already scheduled for deleting.
@@ -137,8 +136,7 @@ void MessageListView::RemoveNotification(MessageView* view) {
void MessageListView::UpdateNotification(MessageView* view,
const Notification& notification) {
// Skip updating the notification being cleared
- if (std::find(clearing_all_views_.begin(), clearing_all_views_.end(), view) !=
- clearing_all_views_.end())
+ if (base::ContainsValue(clearing_all_views_, view))
return;
int index = GetIndexOf(view);
@@ -344,8 +342,7 @@ bool MessageListView::IsValidChild(const views::View* child) const {
deleting_views_.end() &&
deleted_when_done_.find(const_cast<views::View*>(child)) ==
deleted_when_done_.end() &&
- std::find(clearing_all_views_.begin(), clearing_all_views_.end(),
- child) == clearing_all_views_.end();
+ !base::ContainsValue(clearing_all_views_, child);
}
void MessageListView::DoUpdateIfPossible() {
« no previous file with comments | « no previous file | ui/wm/core/shadow_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698