| 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/wm/bezel_controller.h" | 8 #include "athena/wm/bezel_controller.h" |
| 9 #include "athena/wm/public/window_manager_observer.h" | 9 #include "athena/wm/public/window_manager_observer.h" |
| 10 #include "athena/wm/window_overview_mode.h" | 10 #include "athena/wm/window_overview_mode.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 public WindowManagerObserver { | 26 public WindowManagerObserver { |
| 27 public: | 27 public: |
| 28 SplitViewController(aura::Window* container, | 28 SplitViewController(aura::Window* container, |
| 29 WindowListProvider* window_list_provider, | 29 WindowListProvider* window_list_provider, |
| 30 WindowManager* window_manager); | 30 WindowManager* window_manager); |
| 31 | 31 |
| 32 virtual ~SplitViewController(); | 32 virtual ~SplitViewController(); |
| 33 | 33 |
| 34 bool IsSplitViewModeActive() const; | 34 bool IsSplitViewModeActive() const; |
| 35 | 35 |
| 36 void ToggleSplitView(); |
| 37 |
| 36 private: | 38 private: |
| 37 enum State { | 39 enum State { |
| 38 // Split View mode is not active. |left_window_| and |right_window| are | 40 // Split View mode is not active. |left_window_| and |right_window| are |
| 39 // NULL. | 41 // NULL. |
| 40 INACTIVE, | 42 INACTIVE, |
| 41 // Two windows |left_window_| and |right_window| are shown side by side and | 43 // Two windows |left_window_| and |right_window| are shown side by side and |
| 42 // there is a horizontal scroll in progress which is dragging the separator | 44 // there is a horizontal scroll in progress which is dragging the separator |
| 43 // between the two windows. | 45 // between the two windows. |
| 44 SCROLLING, | 46 SCROLLING, |
| 45 // Split View mode is active with |left_window_| and |right_window| showing | 47 // Split View mode is active with |left_window_| and |right_window| showing |
| 46 // side by side each occupying half the screen. No scroll in progress. | 48 // side by side each occupying half the screen. No scroll in progress. |
| 47 ACTIVE | 49 ACTIVE |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 void UpdateLayout(bool animate); | 52 void UpdateLayout(bool animate); |
| 51 | 53 |
| 52 void SetWindowTransform(aura::Window* left_window, | 54 void SetWindowTransform(aura::Window* left_window, |
| 53 const gfx::Transform& transform, | 55 const gfx::Transform& transform, |
| 54 bool animate); | 56 bool animate); |
| 55 | 57 |
| 56 void OnAnimationCompleted(aura::Window* window); | 58 void OnAnimationCompleted(aura::Window* window); |
| 57 | 59 |
| 58 void UpdateSeparatorPositionFromScrollDelta(float delta); | 60 void UpdateSeparatorPositionFromScrollDelta(float delta); |
| 59 | 61 |
| 60 // Returns the current activity shown to the user. Persists through the | 62 // Returns the current activity shown to the user. Persists through the |
| 61 // SCROLLING and ACTIVE states and gets updated if the current activity goes | 63 // SCROLLING and ACTIVE states and gets updated if the current activity goes |
| 62 // off screen when the user switches between activities. | 64 // off screen when the user switches between activities. |
| 63 aura::Window* GetCurrentActivityWindow(); | 65 aura::Window* GetCurrentActivityWindow(); |
| 64 | 66 |
| 65 // BezelController::ScrollDelegate overrides. | 67 // BezelController::ScrollDelegate: |
| 66 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; | 68 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; |
| 67 virtual void ScrollEnd() OVERRIDE; | 69 virtual void ScrollEnd() OVERRIDE; |
| 68 virtual void ScrollUpdate(float delta) OVERRIDE; | 70 virtual void ScrollUpdate(float delta) OVERRIDE; |
| 69 virtual bool CanScroll() OVERRIDE; | 71 virtual bool CanScroll() OVERRIDE; |
| 70 | 72 |
| 71 // WindowManagerObserver | 73 // WindowManagerObserver: |
| 72 virtual void OnOverviewModeEnter() OVERRIDE; | 74 virtual void OnOverviewModeEnter() OVERRIDE; |
| 73 virtual void OnOverviewModeExit() OVERRIDE; | 75 virtual void OnOverviewModeExit() OVERRIDE; |
| 74 | 76 |
| 75 State state_; | 77 State state_; |
| 76 | 78 |
| 77 aura::Window* container_; | 79 aura::Window* container_; |
| 78 | 80 |
| 79 // Window Manager which owns this SplitViewController. | 81 // Window Manager which owns this SplitViewController. |
| 80 // Must be non NULL for the duration of the lifetime. | 82 // Must be non NULL for the duration of the lifetime. |
| 81 WindowManager* window_manager_; | 83 WindowManager* window_manager_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 98 int separator_position_; | 100 int separator_position_; |
| 99 | 101 |
| 100 base::WeakPtrFactory<SplitViewController> weak_factory_; | 102 base::WeakPtrFactory<SplitViewController> weak_factory_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 104 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace athena | 107 } // namespace athena |
| 106 | 108 |
| 107 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 109 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| OLD | NEW |