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

Unified Diff: ash/wm/overview/window_grid.cc

Issue 2901903003: [ash] Cleanup of ScopedOverviewAnimationSettings (Closed)
Patch Set: [ash] Cleanup of ScopedOverviewAnimationSettings 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
Index: ash/wm/overview/window_grid.cc
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc
index f415ffb026b6a6ce68c945f066f6523a87f1d87e..c1d882bf7d9b330b2dcdf68195e386317ac21f77 100644
--- a/ash/wm/overview/window_grid.cc
+++ b/ash/wm/overview/window_grid.cc
@@ -50,20 +50,6 @@
namespace ash {
namespace {
-using Windows = aura::Window::Windows;
-
-// A comparator for locating a given target window.
-struct WindowSelectorItemComparator {
- explicit WindowSelectorItemComparator(const aura::Window* target_window)
- : target(target_window) {}
-
- bool operator()(std::unique_ptr<WindowSelectorItem>& window) const {
- return window->GetWindow() == target;
- }
-
- const aura::Window* target;
-};
-
// Time it takes for the selector widget to move to the next target. The same
// time is used for fading out shield widget when the overview mode is opened
// or closed.
@@ -569,8 +555,9 @@ void WindowGrid::OnWindowDestroying(aura::Window* window) {
window_observer_.Remove(window);
window_state_observer_.Remove(wm::GetWindowState(window));
auto iter = std::find_if(window_list_.begin(), window_list_.end(),
- WindowSelectorItemComparator(window));
-
+ [window](std::unique_ptr<WindowSelectorItem>& item) {
+ return item->GetWindow() == window;
+ });
DCHECK(iter != window_list_.end());
size_t removed_index = iter - window_list_.begin();
@@ -605,7 +592,9 @@ void WindowGrid::OnWindowBoundsChanged(aura::Window* window,
return;
auto iter = std::find_if(window_list_.begin(), window_list_.end(),
- WindowSelectorItemComparator(window));
+ [window](std::unique_ptr<WindowSelectorItem>& item) {
+ return item->GetWindow() == window;
+ });
DCHECK(iter != window_list_.end());
// Immediately finish any active bounds animation.

Powered by Google App Engine
This is Rietveld 408576698