OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/public/cpp/window.h" | 5 #include "components/mus/public/cpp/window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 771 |
772 // static | 772 // static |
773 // Returns true if the order actually changed. | 773 // Returns true if the order actually changed. |
774 bool Window::ReorderImpl(Window* window, | 774 bool Window::ReorderImpl(Window* window, |
775 Window* relative, | 775 Window* relative, |
776 mojom::OrderDirection direction, | 776 mojom::OrderDirection direction, |
777 OrderChangedNotifier* notifier) { | 777 OrderChangedNotifier* notifier) { |
778 DCHECK(relative); | 778 DCHECK(relative); |
779 DCHECK_NE(window, relative); | 779 DCHECK_NE(window, relative); |
780 DCHECK_EQ(window->parent(), relative->parent()); | 780 DCHECK_EQ(window->parent(), relative->parent()); |
| 781 DCHECK(window->parent()); |
781 | 782 |
782 if (!AdjustStackingForTransientWindows(&window, &relative, &direction, | 783 if (!AdjustStackingForTransientWindows(&window, &relative, &direction, |
783 window->stacking_target_)) | 784 window->stacking_target_)) |
784 return false; | 785 return false; |
785 | 786 |
786 const size_t child_i = std::find(window->parent_->children_.begin(), | 787 const size_t child_i = std::find(window->parent_->children_.begin(), |
787 window->parent_->children_.end(), window) - | 788 window->parent_->children_.end(), window) - |
788 window->parent_->children_.begin(); | 789 window->parent_->children_.begin(); |
789 const size_t target_i = | 790 const size_t target_i = |
790 std::find(window->parent_->children_.begin(), | 791 std::find(window->parent_->children_.begin(), |
(...skipping 21 matching lines...) Expand all Loading... |
812 notifier->NotifyWindowReordered(); | 813 notifier->NotifyWindowReordered(); |
813 | 814 |
814 return true; | 815 return true; |
815 } | 816 } |
816 | 817 |
817 // static | 818 // static |
818 Window** Window::GetStackingTarget(Window* window) { | 819 Window** Window::GetStackingTarget(Window* window) { |
819 return &window->stacking_target_; | 820 return &window->stacking_target_; |
820 } | 821 } |
821 } // namespace mus | 822 } // namespace mus |
OLD | NEW |