| 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 "athena/wm/window_list_provider_impl.h" | 5 #include "athena/wm/window_list_provider_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "athena/wm/public/window_list_provider_observer.h" | 9 #include "athena/wm/public/window_list_provider_observer.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 bool WindowListProviderImpl::IsWindowInList(aura::Window* window) const { | 59 bool WindowListProviderImpl::IsWindowInList(aura::Window* window) const { |
| 60 return window->parent() == container_ && IsValidWindow(window); | 60 return window->parent() == container_ && IsValidWindow(window); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool WindowListProviderImpl::IsValidWindow(aura::Window* window) const { | 63 bool WindowListProviderImpl::IsValidWindow(aura::Window* window) const { |
| 64 // TODO(oshima): crbug.com/413912 | 64 // TODO(oshima): crbug.com/413912 |
| 65 return window->type() == ui::wm::WINDOW_TYPE_NORMAL || | 65 return window->type() == ui::wm::WINDOW_TYPE_NORMAL || |
| 66 window->type() == ui::wm::WINDOW_TYPE_PANEL; | 66 window->type() == ui::wm::WINDOW_TYPE_PANEL; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WindowListProviderImpl::MoveToFront(aura::Window* window) { | |
| 70 DCHECK(IsWindowInList(window)); | |
| 71 container_->StackChildAtTop(window); | |
| 72 } | |
| 73 | |
| 74 void WindowListProviderImpl::StackWindowFrontOf( | 69 void WindowListProviderImpl::StackWindowFrontOf( |
| 75 aura::Window* window, | 70 aura::Window* window, |
| 76 aura::Window* reference_window) { | 71 aura::Window* reference_window) { |
| 77 DCHECK_NE(window, reference_window); | 72 DCHECK_NE(window, reference_window); |
| 78 DCHECK(IsWindowInList(window)); | 73 DCHECK(IsWindowInList(window)); |
| 79 DCHECK(IsWindowInList(reference_window)); | 74 DCHECK(IsWindowInList(reference_window)); |
| 80 container_->StackChildAbove(window, reference_window); | 75 container_->StackChildAbove(window, reference_window); |
| 81 } | 76 } |
| 82 | 77 |
| 83 void WindowListProviderImpl::StackWindowBehindTo( | 78 void WindowListProviderImpl::StackWindowBehindTo( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return; | 112 return; |
| 118 DCHECK(IsWindowInList(window)); | 113 DCHECK(IsWindowInList(window)); |
| 119 RecreateWindowList(); | 114 RecreateWindowList(); |
| 120 // Inform our listeners that the stacking has been changed. | 115 // Inform our listeners that the stacking has been changed. |
| 121 FOR_EACH_OBSERVER(WindowListProviderObserver, | 116 FOR_EACH_OBSERVER(WindowListProviderObserver, |
| 122 observers_, | 117 observers_, |
| 123 OnWindowStackingChanged()); | 118 OnWindowStackingChanged()); |
| 124 } | 119 } |
| 125 | 120 |
| 126 } // namespace athena | 121 } // namespace athena |
| OLD | NEW |