Chromium Code Reviews| 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" | |
| 10 #include "athena/wm/window_overview_mode.h" | |
| 9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "ui/compositor/layer_animation_observer.h" | |
| 14 | |
| 15 namespace gfx { | |
| 16 class Transform; | |
| 17 } | |
| 18 | |
| 19 namespace ui { | |
| 20 class LayerAnimationSequence; | |
|
Jun Mukai
2014/07/25 20:21:29
Remove unused declaration
mfomitchev
2014/07/25 23:27:38
Done.
| |
| 21 } | |
| 10 | 22 |
| 11 namespace athena { | 23 namespace athena { |
| 24 class WindowManager; | |
| 25 class WindowOverviewModeDelegate; | |
| 26 class WindowStackProvider; | |
| 12 | 27 |
| 13 // Responsible for entering split view mode, exiting from split view mode, and | 28 // Responsible for entering split view mode, exiting from split view mode, and |
| 14 // laying out the windows in split view mode. | 29 // laying out the windows in split view mode. |
| 15 class SplitViewController : public BezelController::ScrollDelegate { | 30 class SplitViewController : public BezelController::ScrollDelegate, |
| 31 public WindowManagerObserver { | |
| 16 public: | 32 public: |
| 17 SplitViewController(); | |
| 18 virtual ~SplitViewController(); | 33 virtual ~SplitViewController(); |
| 34 SplitViewController(aura::Window* container, | |
| 35 WindowStackProvider* window_stack_provider, | |
| 36 WindowManager* window_manager); | |
| 37 | |
| 38 | |
| 39 bool IsSplitViewModeActive(); | |
| 19 | 40 |
| 20 private: | 41 private: |
| 42 enum State {INACTIVE, SCROLLING, ACTIVE}; | |
| 43 | |
| 44 void Layout(bool animate); | |
| 45 | |
| 46 void SetWindowTransform( | |
| 47 aura::Window* window, const gfx::Transform& transform, bool animate); | |
| 48 | |
| 49 void AnimationCompleted(); | |
| 50 | |
| 51 void UpdateSeparatorPositionFromScrollDelta(float delta); | |
| 52 | |
| 53 aura::Window* GetCurrentWindow(); | |
| 54 | |
| 21 // BezelController::ScrollDelegate overrides. | 55 // BezelController::ScrollDelegate overrides. |
| 22 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; | 56 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; |
| 23 virtual void ScrollEnd() OVERRIDE; | 57 virtual void ScrollEnd() OVERRIDE; |
| 24 virtual void ScrollUpdate(float delta) OVERRIDE; | 58 virtual void ScrollUpdate(float delta) OVERRIDE; |
| 25 virtual bool CanScroll() OVERRIDE; | 59 virtual bool CanScroll() OVERRIDE; |
| 26 | 60 |
| 61 // WindowManagerObserver overrides | |
| 62 virtual void OnOverviewModeEnter() OVERRIDE; | |
| 63 virtual void OnOverviewModeExit() OVERRIDE {} | |
|
Jun Mukai
2014/07/25 20:21:29
Please move the implementation to .cc file even it
mfomitchev
2014/07/25 23:27:38
Done.
| |
| 64 | |
| 65 base::WeakPtrFactory<SplitViewController> weak_factory_; | |
| 66 | |
| 67 State state_; | |
| 68 | |
| 69 aura::Window* container_; | |
| 70 WindowManager* window_manager_; | |
| 71 WindowStackProvider* window_stack_provider_; | |
| 72 | |
| 73 aura::Window* current_window_; | |
| 74 aura::Window* left_window_; | |
| 75 aura::Window* right_window_; | |
| 76 int separator_position_; | |
| 77 | |
| 78 //scoped_ptr<CurrentWindowTracker> current_window_tracker_; | |
| 79 | |
| 27 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 80 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
| 28 }; | 81 }; |
| 29 | 82 |
| 30 } // namespace athena | 83 } // namespace athena |
| 31 | 84 |
| 32 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 85 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| OLD | NEW |