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 Transform; | 15 class Transform; |
15 } | 16 } |
16 | 17 |
17 namespace athena { | 18 namespace athena { |
18 class WindowListProvider; | 19 class WindowListProvider; |
19 | 20 |
20 // Responsible for entering split view mode, exiting from split view mode, and | 21 // Responsible for entering split view mode, exiting from split view mode, and |
21 // laying out the windows in split view mode. | 22 // laying out the windows in split view mode. |
22 class ATHENA_EXPORT SplitViewController | 23 class ATHENA_EXPORT SplitViewController |
23 : public BezelController::ScrollDelegate { | 24 : public BezelController::ScrollDelegate { |
(...skipping 11 matching lines...) Expand all Loading... |
35 void ActivateSplitMode(aura::Window* left, aura::Window* right); | 36 void ActivateSplitMode(aura::Window* left, aura::Window* right); |
36 | 37 |
37 // 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 |
38 // 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 |
39 // making any necessary changes. | 40 // making any necessary changes. |
40 void DeactivateSplitMode(); | 41 void DeactivateSplitMode(); |
41 | 42 |
42 void ReplaceWindow(aura::Window* window, | 43 void ReplaceWindow(aura::Window* window, |
43 aura::Window* replace_with); | 44 aura::Window* replace_with); |
44 | 45 |
| 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 |
| 48 // |right_window_| are still animating this may be different than their |
| 49 // current bounds. |
| 50 gfx::Rect GetLeftTargetBounds(); |
| 51 gfx::Rect GetRightTargetBounds(); |
| 52 |
45 aura::Window* left_window() { return left_window_; } | 53 aura::Window* left_window() { return left_window_; } |
46 aura::Window* right_window() { return right_window_; } | 54 aura::Window* right_window() { return right_window_; } |
47 | 55 |
48 private: | 56 private: |
49 enum State { | 57 enum State { |
50 // Split View mode is not active. |left_window_| and |right_window| are | 58 // Split View mode is not active. |left_window_| and |right_window| are |
51 // NULL. | 59 // NULL. |
52 INACTIVE, | 60 INACTIVE, |
53 // Two windows |left_window_| and |right_window| are shown side by side and | 61 // Two windows |left_window_| and |right_window| are shown side by side and |
54 // 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 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 int separator_position_; | 100 int separator_position_; |
93 | 101 |
94 base::WeakPtrFactory<SplitViewController> weak_factory_; | 102 base::WeakPtrFactory<SplitViewController> weak_factory_; |
95 | 103 |
96 DISALLOW_COPY_AND_ASSIGN(SplitViewController); | 104 DISALLOW_COPY_AND_ASSIGN(SplitViewController); |
97 }; | 105 }; |
98 | 106 |
99 } // namespace athena | 107 } // namespace athena |
100 | 108 |
101 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ | 109 #endif // ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_ |
OLD | NEW |