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" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 bool IsSplitViewModeActive() const; | 31 bool IsSplitViewModeActive() const; |
32 | 32 |
33 // Activates split-view mode with |left| and |right| windows. If |left| and/or | 33 // Activates split-view mode with |left| and |right| windows. If |left| and/or |
34 // |right| is NULL, then the first window in the window-list (which is neither | 34 // |right| is NULL, then the first window in the window-list (which is neither |
35 // |left| nor |right|) is selected instead. | 35 // |left| nor |right|) is selected instead. |
36 void ActivateSplitMode(aura::Window* left, aura::Window* right); | 36 void ActivateSplitMode(aura::Window* left, aura::Window* right); |
37 | 37 |
38 // Resets the internal state to an inactive state. Calling this does not | 38 // Resets the internal state to an inactive state. Calling this does not |
39 // change the window bounds/transforms etc. The caller must take care of | 39 // change the window bounds/transforms etc. The caller must take care of |
40 // making any necessary changes. | 40 // making any necessary changes. |
41 void DeactivateSplitMode(); | 41 void DeactivateSplitMode(); |
oshima
2014/08/29 21:57:06
nit: can you update the comment?
| |
42 | 42 |
43 void ReplaceWindow(aura::Window* window, | 43 void ReplaceWindow(aura::Window* window, |
44 aura::Window* replace_with); | 44 aura::Window* replace_with); |
45 | 45 |
46 // Returns the bounds that the left and right windows will have once split | 46 // Returns the bounds that the left and right windows will have once split |
47 // view is active and they are done animating. If |left_window_| and | 47 // view is active and they are done animating. If |left_window_| and |
48 // |right_window_| are still animating this may be different than their | 48 // |right_window_| are still animating this may be different than their |
49 // current bounds. | 49 // current bounds. |
50 gfx::Rect GetLeftTargetBounds(); | 50 gfx::Rect GetLeftTargetBounds(); |
51 gfx::Rect GetRightTargetBounds(); | 51 gfx::Rect GetRightTargetBounds(); |
(...skipping 10 matching lines...) Expand all Loading... | |
62 // there is a horizontal scroll in progress which is dragging the separator | 62 // there is a horizontal scroll in progress which is dragging the separator |
63 // between the two windows. | 63 // between the two windows. |
64 SCROLLING, | 64 SCROLLING, |
65 // Split View mode is active with |left_window_| and |right_window| showing | 65 // Split View mode is active with |left_window_| and |right_window| showing |
66 // side by side each occupying half the screen. No scroll in progress. | 66 // side by side each occupying half the screen. No scroll in progress. |
67 ACTIVE | 67 ACTIVE |
68 }; | 68 }; |
69 | 69 |
70 void UpdateLayout(bool animate); | 70 void UpdateLayout(bool animate); |
71 | 71 |
72 void SetWindowTransform(aura::Window* left_window, | 72 void SetWindowTransforms(const gfx::Transform& left_transform, |
73 const gfx::Transform& transform, | 73 const gfx::Transform& right_transform, |
74 bool animate); | 74 bool animate); |
75 | 75 |
76 void OnAnimationCompleted(aura::Window* window); | 76 void OnAnimationCompleted(); |
oshima
2014/08/29 21:57:06
can you add comment that this is called once for e
| |
77 | 77 |
78 void UpdateSeparatorPositionFromScrollDelta(float delta); | 78 void UpdateSeparatorPositionFromScrollDelta(float delta); |
79 | 79 |
80 // BezelController::ScrollDelegate: | 80 // BezelController::ScrollDelegate: |
81 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; | 81 virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE; |
82 virtual void ScrollEnd() OVERRIDE; | 82 virtual void ScrollEnd() OVERRIDE; |
83 virtual void ScrollUpdate(float delta) OVERRIDE; | 83 virtual void ScrollUpdate(float delta) OVERRIDE; |
84 virtual bool CanScroll() OVERRIDE; | 84 virtual bool CanScroll() OVERRIDE; |
85 | 85 |
86 State state_; | 86 State state_; |
(...skipping 13 matching lines...) Expand all Loading... | |
100 int separator_position_; | 100 int separator_position_; |
101 | 101 |
102 base::WeakPtrFactory<SplitViewController> weak_factory_; | 102 base::WeakPtrFactory<SplitViewController> weak_factory_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 104 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace athena | 107 } // namespace athena |
108 | 108 |
109 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 109 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
OLD | NEW |