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

Unified Diff: chromecast/graphics/cast_focus_client_aura.cc

Issue 2920723002: Use ContainsValue() instead of std::find() in chromecast/ (Closed)
Patch Set: Adding blank line and removing an extra line. Created 3 years, 7 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 | « chromecast/base/observer.h ('k') | chromecast/media/audio/cast_audio_mixer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/graphics/cast_focus_client_aura.cc
diff --git a/chromecast/graphics/cast_focus_client_aura.cc b/chromecast/graphics/cast_focus_client_aura.cc
index 50881616ebcfa88e20ac2c05d9fd01425b3402ee..fb339d10e84de3ce869b11d89dc3a8eebb0c1655 100644
--- a/chromecast/graphics/cast_focus_client_aura.cc
+++ b/chromecast/graphics/cast_focus_client_aura.cc
@@ -4,6 +4,7 @@
#include "chromecast/graphics/cast_focus_client_aura.h"
+#include "base/stl_util.h"
#include "ui/aura/window.h"
#define LOG_WINDOW_INFO(top_level, window) \
@@ -124,9 +125,7 @@ void CastFocusClientAura::FocusWindow(aura::Window* window) {
aura::Window* top_level = GetZOrderWindow(window);
DCHECK(top_level);
DLOG(INFO) << "Requesting focus for " << LOG_WINDOW_INFO(top_level, window);
- auto iter =
- std::find(focusable_windows_.begin(), focusable_windows_.end(), window);
- if (iter == focusable_windows_.end()) {
+ if (!base::ContainsValue(focusable_windows_, window)) {
// We're not yet tracking this focusable window, so start tracking it as a
// potential focus target.
window->AddObserver(this);
« no previous file with comments | « chromecast/base/observer.h ('k') | chromecast/media/audio/cast_audio_mixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698