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

Unified Diff: ui/wm/core/shadow_controller.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 | « ui/message_center/views/message_list_view.cc ('k') | ui/wm/core/transient_window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/shadow_controller.cc
diff --git a/ui/wm/core/shadow_controller.cc b/ui/wm/core/shadow_controller.cc
index 82aabd8dd3401fb60d0de8256bee5ac10f0cdd40..31a4abe0ec75447b1cbd07105831f984f18cf8b1 100644
--- a/ui/wm/core/shadow_controller.cc
+++ b/ui/wm/core/shadow_controller.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/scoped_observer.h"
+#include "base/stl_util.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/env_observer.h"
@@ -77,11 +78,8 @@ ShadowElevation GetShadowElevationForWindowLosingActive(
aura::Window* losing_active,
aura::Window* gaining_active) {
if (gaining_active && GetHideOnDeactivate(gaining_active)) {
- aura::Window::Windows::const_iterator it =
- std::find(GetTransientChildren(losing_active).begin(),
- GetTransientChildren(losing_active).end(),
- gaining_active);
- if (it != GetTransientChildren(losing_active).end())
+ if (base::ContainsValue(GetTransientChildren(losing_active),
+ gaining_active))
return ShadowController::kActiveNormalShadowElevation;
}
return kInactiveNormalShadowElevation;
« no previous file with comments | « ui/message_center/views/message_list_view.cc ('k') | ui/wm/core/transient_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698