| 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 #ifndef ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 5 #ifndef ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| 6 #define ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 6 #define ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "athena/athena_export.h" | 8 #include "athena/athena_export.h" |
| 9 #include "athena/wm/bezel_controller.h" | 9 #include "athena/wm/bezel_controller.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Rect; | 14 class Rect; |
| 15 class Transform; | 15 class Transform; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace athena { | 18 namespace athena { |
| 19 class WindowListProvider; | 19 class WindowListProvider; |
| 20 class SplitViewControllerTest; |
| 20 | 21 |
| 21 // Responsible for entering split view mode, exiting from split view mode, and | 22 // Responsible for entering split view mode, exiting from split view mode, and |
| 22 // laying out the windows in split view mode. | 23 // laying out the windows in split view mode. |
| 23 class ATHENA_EXPORT SplitViewController | 24 class ATHENA_EXPORT SplitViewController |
| 24 : public BezelController::ScrollDelegate { | 25 : public BezelController::ScrollDelegate { |
| 25 public: | 26 public: |
| 26 SplitViewController(aura::Window* container, | 27 SplitViewController(aura::Window* container, |
| 27 WindowListProvider* window_list_provider); | 28 WindowListProvider* window_list_provider); |
| 28 | 29 |
| 29 virtual ~SplitViewController(); | 30 virtual ~SplitViewController(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 48 // view is active and they are done animating. If |left_window_| and | 49 // view is active and they are done animating. If |left_window_| and |
| 49 // |right_window_| are still animating this may be different than their | 50 // |right_window_| are still animating this may be different than their |
| 50 // current bounds. | 51 // current bounds. |
| 51 gfx::Rect GetLeftTargetBounds(); | 52 gfx::Rect GetLeftTargetBounds(); |
| 52 gfx::Rect GetRightTargetBounds(); | 53 gfx::Rect GetRightTargetBounds(); |
| 53 | 54 |
| 54 aura::Window* left_window() { return left_window_; } | 55 aura::Window* left_window() { return left_window_; } |
| 55 aura::Window* right_window() { return right_window_; } | 56 aura::Window* right_window() { return right_window_; } |
| 56 | 57 |
| 57 private: | 58 private: |
| 59 friend class SplitViewControllerTest; |
| 60 |
| 58 enum State { | 61 enum State { |
| 59 // Split View mode is not active. |left_window_| and |right_window| are | 62 // Split View mode is not active. |left_window_| and |right_window| are |
| 60 // NULL. | 63 // NULL. |
| 61 INACTIVE, | 64 INACTIVE, |
| 62 // Two windows |left_window_| and |right_window| are shown side by side and | 65 // Two windows |left_window_| and |right_window| are shown side by side and |
| 63 // there is a horizontal scroll in progress which is dragging the separator | 66 // there is a horizontal scroll in progress which is dragging the separator |
| 64 // between the two windows. | 67 // between the two windows. |
| 65 SCROLLING, | 68 SCROLLING, |
| 66 // Split View mode is active with |left_window_| and |right_window| showing | 69 // Split View mode is active with |left_window_| and |right_window| showing |
| 67 // side by side each occupying half the screen. No scroll in progress. | 70 // side by side each occupying half the screen. No scroll in progress. |
| 68 ACTIVE | 71 ACTIVE |
| 69 }; | 72 }; |
| 70 | 73 |
| 74 void SetState(State state); |
| 71 void UpdateLayout(bool animate); | 75 void UpdateLayout(bool animate); |
| 72 | 76 |
| 73 void SetWindowTransforms(const gfx::Transform& left_transform, | 77 void SetWindowTransforms(const gfx::Transform& left_transform, |
| 74 const gfx::Transform& right_transform, | 78 const gfx::Transform& right_transform, |
| 75 bool animate); | 79 bool animate); |
| 76 | 80 |
| 77 // Called when the animation initiated by SetWindowTransforms() completes. | 81 // Called when the animation initiated by SetWindowTransforms() completes. |
| 78 void OnAnimationCompleted(); | 82 void OnAnimationCompleted(); |
| 79 | 83 |
| 80 void UpdateSeparatorPositionFromScrollDelta(float delta); | 84 void UpdateSeparatorPositionFromScrollDelta(float delta); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 102 int separator_position_; | 106 int separator_position_; |
| 103 | 107 |
| 104 base::WeakPtrFactory<SplitViewController> weak_factory_; | 108 base::WeakPtrFactory<SplitViewController> weak_factory_; |
| 105 | 109 |
| 106 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 110 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace athena | 113 } // namespace athena |
| 110 | 114 |
| 111 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 115 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| OLD | NEW |