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/split_view_controller.h" | 5 #include "athena/wm/split_view_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "athena/screen/public/screen_manager.h" | 9 #include "athena/screen/public/screen_manager.h" |
10 #include "athena/wm/public/window_list_provider.h" | 10 #include "athena/wm/public/window_list_provider.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 iter++; | 90 iter++; |
91 if (right == left && iter != windows.rend()) { | 91 if (right == left && iter != windows.rend()) { |
92 right = *iter; | 92 right = *iter; |
93 iter++; | 93 iter++; |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 SetState(ACTIVE); | 97 SetState(ACTIVE); |
98 if (right_window_ != right) { | 98 if (right_window_ != right) { |
99 right_window_ = right; | 99 right_window_ = right; |
100 container_->StackChildAtTop(right_window_); | 100 // Since the |window_list_provider_| controls directly the order of windows, |
| 101 // it needs to change the window order accordingly. |
| 102 window_list_provider_->MoveToFront(right_window_); |
101 } | 103 } |
102 if (left_window_ != left) { | 104 if (left_window_ != left) { |
103 left_window_ = left; | 105 left_window_ = left; |
104 container_->StackChildAtTop(left_window_); | 106 // Since the |window_list_provider_| controls directly the order of windows, |
| 107 // it needs to change the window order accordingly. |
| 108 window_list_provider_->MoveToFront(left_window_); |
105 } | 109 } |
106 UpdateLayout(true); | 110 UpdateLayout(true); |
107 } | 111 } |
108 | 112 |
109 void SplitViewController::ReplaceWindow(aura::Window* window, | 113 void SplitViewController::ReplaceWindow(aura::Window* window, |
110 aura::Window* replace_with) { | 114 aura::Window* replace_with) { |
111 CHECK(IsSplitViewModeActive()); | 115 CHECK(IsSplitViewModeActive()); |
112 CHECK(replace_with); | 116 CHECK(replace_with); |
113 CHECK(window == left_window_ || window == right_window_); | 117 CHECK(window == left_window_ || window == right_window_); |
114 CHECK(replace_with != left_window_ && replace_with != right_window_); | 118 CHECK(replace_with != left_window_ && replace_with != right_window_); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 bool SplitViewController::CanScroll() { | 316 bool SplitViewController::CanScroll() { |
313 // TODO(mfomitchev): return false in full screen. | 317 // TODO(mfomitchev): return false in full screen. |
314 bool result = (!IsSplitViewModeActive() && | 318 bool result = (!IsSplitViewModeActive() && |
315 window_list_provider_->GetWindowList().size() >= 2 && | 319 window_list_provider_->GetWindowList().size() >= 2 && |
316 IsLandscapeOrientation(gfx::Screen::GetNativeScreen()-> | 320 IsLandscapeOrientation(gfx::Screen::GetNativeScreen()-> |
317 GetDisplayNearestWindow(container_).rotation())); | 321 GetDisplayNearestWindow(container_).rotation())); |
318 return result; | 322 return result; |
319 } | 323 } |
320 | 324 |
321 } // namespace athena | 325 } // namespace athena |
OLD | NEW |