Chromium Code Reviews| 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 if (!window->parent()) | |
| 782 return false; | |
|
sadrul
2016/01/11 21:37:34
There is probably a bug that the WS sends reorder
sadrul
2016/01/12 21:50:48
Put up https://codereview.chromium.org/1580193002/
| |
| 781 | 783 |
| 782 if (!AdjustStackingForTransientWindows(&window, &relative, &direction, | 784 if (!AdjustStackingForTransientWindows(&window, &relative, &direction, |
| 783 window->stacking_target_)) | 785 window->stacking_target_)) |
| 784 return false; | 786 return false; |
| 785 | 787 |
| 786 const size_t child_i = std::find(window->parent_->children_.begin(), | 788 const size_t child_i = std::find(window->parent_->children_.begin(), |
| 787 window->parent_->children_.end(), window) - | 789 window->parent_->children_.end(), window) - |
| 788 window->parent_->children_.begin(); | 790 window->parent_->children_.begin(); |
| 789 const size_t target_i = | 791 const size_t target_i = |
| 790 std::find(window->parent_->children_.begin(), | 792 std::find(window->parent_->children_.begin(), |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 812 notifier->NotifyWindowReordered(); | 814 notifier->NotifyWindowReordered(); |
| 813 | 815 |
| 814 return true; | 816 return true; |
| 815 } | 817 } |
| 816 | 818 |
| 817 // static | 819 // static |
| 818 Window** Window::GetStackingTarget(Window* window) { | 820 Window** Window::GetStackingTarget(Window* window) { |
| 819 return &window->stacking_target_; | 821 return &window->stacking_target_; |
| 820 } | 822 } |
| 821 } // namespace mus | 823 } // namespace mus |
| OLD | NEW |