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

Side by Side Diff: ui/wm/core/window_animations.cc

Issue 1485093003: ui: use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review + view.cc fix Created 5 years 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 unified diff | Download patch
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/wm/core/window_animations.h" 5 #include "ui/wm/core/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (window_->parent()) { 88 if (window_->parent()) {
89 const aura::Window::Windows& transient_children = 89 const aura::Window::Windows& transient_children =
90 GetTransientChildren(window_); 90 GetTransientChildren(window_);
91 aura::Window::Windows::const_iterator iter = 91 aura::Window::Windows::const_iterator iter =
92 std::find(window_->parent()->children().begin(), 92 std::find(window_->parent()->children().begin(),
93 window_->parent()->children().end(), 93 window_->parent()->children().end(),
94 window_); 94 window_);
95 DCHECK(iter != window_->parent()->children().end()); 95 DCHECK(iter != window_->parent()->children().end());
96 aura::Window* topmost_transient_child = NULL; 96 aura::Window* topmost_transient_child = NULL;
97 for (++iter; iter != window_->parent()->children().end(); ++iter) { 97 for (++iter; iter != window_->parent()->children().end(); ++iter) {
98 if (std::find(transient_children.begin(), 98 if (ContainsValue(transient_children, *iter))
99 transient_children.end(),
100 *iter) != transient_children.end()) {
101 topmost_transient_child = *iter; 99 topmost_transient_child = *iter;
102 }
103 } 100 }
104 if (topmost_transient_child) { 101 if (topmost_transient_child) {
105 window_->parent()->layer()->StackAbove( 102 window_->parent()->layer()->StackAbove(
106 layer_owner_->root(), topmost_transient_child->layer()); 103 layer_owner_->root(), topmost_transient_child->layer());
107 } 104 }
108 } 105 }
109 } 106 }
110 107
111 protected: 108 protected:
112 // Invoked when the hiding animation is completed. It will delete 109 // Invoked when the hiding animation is completed. It will delete
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // being accessed via Remote Desktop. 656 // being accessed via Remote Desktop.
660 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == 657 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() ==
661 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) 658 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION)
662 return false; 659 return false;
663 660
664 // Let the user decide whether or not to play the animation. 661 // Let the user decide whether or not to play the animation.
665 return !gfx::Animation::ShouldRenderRichAnimation(); 662 return !gfx::Animation::ShouldRenderRichAnimation();
666 } 663 }
667 664
668 } // namespace wm 665 } // namespace wm
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698