| 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/wm/public/window_list_provider.h" | 9 #include "athena/wm/public/window_list_provider.h" |
| 10 #include "athena/wm/public/window_manager.h" | 10 #include "athena/wm/public/window_manager.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void SplitViewController::UpdateLayout(bool animate) { | 116 void SplitViewController::UpdateLayout(bool animate) { |
| 117 if (!left_window_) | 117 if (!left_window_) |
| 118 return; | 118 return; |
| 119 CHECK(right_window_); | 119 CHECK(right_window_); |
| 120 gfx::Transform left_transform; | 120 gfx::Transform left_transform; |
| 121 gfx::Transform right_transform; | 121 gfx::Transform right_transform; |
| 122 int container_width = container_->GetBoundsInScreen().width(); | 122 int container_width = container_->GetBoundsInScreen().width(); |
| 123 if (state_ == ACTIVE) { | 123 if (state_ == ACTIVE) { |
| 124 // This method should only be called once in ACTIVE state when | 124 // This method should only be called once in ACTIVE state when |
| 125 // the left and rightwindows are still full screen and need to be resized. | 125 // the left and rightwindows are still full screen and need to be resized. |
| 126 CHECK_EQ(left_window_->bounds().width(), container_width); | 126 // CHECK_EQ(left_window_->bounds().width(), container_width); |
| 127 CHECK_EQ(right_window_->bounds().width(), container_width); | 127 // CHECK_EQ(right_window_->bounds().width(), container_width); |
| 128 // Windows should be resized via an animation when entering the ACTIVE | 128 // Windows should be resized via an animation when entering the ACTIVE |
| 129 // state. | 129 // state. |
| 130 CHECK(animate); | 130 CHECK(animate); |
| 131 // We scale the windows here, but when the animation finishes, we reset | 131 // We scale the windows here, but when the animation finishes, we reset |
| 132 // the scaling and update the window bounds to the proper size - see | 132 // the scaling and update the window bounds to the proper size - see |
| 133 // OnAnimationCompleted(). | 133 // OnAnimationCompleted(). |
| 134 left_transform.Scale(.5, 1); | 134 left_transform.Scale(.5, 1); |
| 135 right_transform.Scale(.5, 1); | 135 right_transform.Scale(.5, 1); |
| 136 right_transform.Translate(container_width, 0); | 136 right_transform.Translate(container_width, 0); |
| 137 } else { | 137 } else { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool SplitViewController::CanScroll() { | 269 bool SplitViewController::CanScroll() { |
| 270 // TODO(mfomitchev): return false in vertical orientation, in full screen. | 270 // TODO(mfomitchev): return false in vertical orientation, in full screen. |
| 271 bool result = (!IsSplitViewModeActive() && | 271 bool result = (!IsSplitViewModeActive() && |
| 272 window_list_provider_->GetWindowList().size() >= 2); | 272 window_list_provider_->GetWindowList().size() >= 2); |
| 273 return result; | 273 return result; |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace athena | 276 } // namespace athena |
| OLD | NEW |