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" | |
|
Jun Mukai
2014/08/06 20:49:01
Is this include necessary here?
mfomitchev
2014/08/08 16:03:22
Leftover from old code, thanks for catching. Fixed
| |
| 14 | |
| 15 namespace gfx { | |
| 16 class Transform; | |
| 17 } | |
| 18 | |
| 19 namespace wm { | |
| 20 class WindowListProvider; | |
| 21 } | |
| 10 | 22 |
| 11 namespace athena { | 23 namespace athena { |
| 24 class WindowManager; | |
| 25 class WindowOverviewModeDelegate; | |
| 12 | 26 |
| 13 // Responsible for entering split view mode, exiting from split view mode, and | 27 // Responsible for entering split view mode, exiting from split view mode, and |
| 14 // laying out the windows in split view mode. | 28 // laying out the windows in split view mode. |
| 15 class SplitViewController : public BezelController::ScrollDelegate { | 29 class SplitViewController : public BezelController::ScrollDelegate, |
| 30 public WindowManagerObserver { | |
| 16 public: | 31 public: |
| 17 SplitViewController(); | |
| 18 virtual ~SplitViewController(); | 32 virtual ~SplitViewController(); |
|
oshima
2014/08/06 21:54:09
move dtor after ctor
mfomitchev
2014/08/08 16:03:23
Done.
| |
| 33 SplitViewController(aura::Window* container, | |
| 34 wm::WindowListProvider* window_list_provider, | |
| 35 WindowManager* window_manager); | |
| 36 | |
| 37 | |
| 38 bool IsSplitViewModeActive(); | |
| 19 | 39 |
| 20 private: | 40 private: |
| 41 enum State {INACTIVE, SCROLLING, ACTIVE}; | |
|
oshima
2014/08/06 21:54:09
document these states.
mfomitchev
2014/08/08 16:03:22
Done.
| |
| 42 | |
| 43 void Layout(bool animate); | |
| 44 | |
| 45 void SetWindowTransform( | |
| 46 aura::Window* window, const gfx::Transform& transform, bool animate); | |
| 47 | |
| 48 void AnimationCompleted(); | |
|
oshima
2014/08/06 21:54:10
OnAnimationCompleted ( to be consistent with patte
mfomitchev
2014/08/08 16:03:23
Done.
| |
| 49 | |
| 50 void UpdateSeparatorPositionFromScrollDelta(float delta); | |
| 51 | |
| 52 aura::Window* GetCurrentWindow(); | |
|
oshima
2014/08/06 21:54:09
document what is *current* window. If it's active
mfomitchev
2014/08/08 16:03:22
I added comments. Unfortunately GetActiveWindow()
| |
| 53 | |
| 21 // BezelController::ScrollDelegate overrides. | 54 // BezelController::ScrollDelegate overrides. |
| 22 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; | 55 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; |
| 23 virtual void ScrollEnd() OVERRIDE; | 56 virtual void ScrollEnd() OVERRIDE; |
| 24 virtual void ScrollUpdate(float delta) OVERRIDE; | 57 virtual void ScrollUpdate(float delta) OVERRIDE; |
| 25 virtual bool CanScroll() OVERRIDE; | 58 virtual bool CanScroll() OVERRIDE; |
| 26 | 59 |
| 60 // WindowManagerObserver overrides | |
|
oshima
2014/08/06 21:54:09
// WindowManagerObserver:
(no "overrides" require
mfomitchev
2014/08/08 16:03:23
Done.
| |
| 61 virtual void OnOverviewModeEnter() OVERRIDE; | |
| 62 virtual void OnOverviewModeExit() OVERRIDE; | |
| 63 | |
| 64 base::WeakPtrFactory<SplitViewController> weak_factory_; | |
| 65 | |
| 66 State state_; | |
| 67 | |
| 68 aura::Window* container_; | |
| 69 WindowManager* window_manager_; | |
| 70 wm::WindowListProvider* window_list_provider_; | |
| 71 | |
| 72 aura::Window* current_window_; | |
| 73 aura::Window* left_window_; | |
| 74 aura::Window* right_window_; | |
| 75 // Position of the separator between left_window_ and right_window_ in | |
|
oshima
2014/08/06 21:54:09
new line before comment
mfomitchev
2014/08/08 16:03:22
Done.
| |
| 76 // container_ coordinates (along the x axis). | |
| 77 int separator_position_; | |
| 78 | |
| 27 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 79 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
| 28 }; | 80 }; |
| 29 | 81 |
| 30 } // namespace athena | 82 } // namespace athena |
| 31 | 83 |
| 32 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 84 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
| OLD | NEW |