| Index: athena/wm/split_view_controller.h
|
| diff --git a/athena/wm/split_view_controller.h b/athena/wm/split_view_controller.h
|
| index c6c5e8e23c01f35624982a1a85fe7c0ca24bc7ef..aa279f49655fa092e2622635c856fdd27b1f403e 100644
|
| --- a/athena/wm/split_view_controller.h
|
| +++ b/athena/wm/split_view_controller.h
|
| @@ -6,7 +6,9 @@
|
| #define ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_
|
|
|
| #include "athena/athena_export.h"
|
| +#include "athena/common/drag_handle.h"
|
| #include "athena/wm/bezel_controller.h"
|
| +#include "athena/wm/public/window_manager_observer.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
|
|
| @@ -15,6 +17,16 @@ class Rect;
|
| class Transform;
|
| }
|
|
|
| +namespace aura {
|
| +class ScopedWindowTargeter;
|
| +class Window;
|
| +class WindowTargeter;
|
| +}
|
| +
|
| +namespace views {
|
| +class Widget;
|
| +}
|
| +
|
| namespace athena {
|
| class WindowListProvider;
|
| class SplitViewControllerTest;
|
| @@ -22,7 +34,9 @@ class SplitViewControllerTest;
|
| // Responsible for entering split view mode, exiting from split view mode, and
|
| // laying out the windows in split view mode.
|
| class ATHENA_EXPORT SplitViewController
|
| - : public BezelController::ScrollDelegate {
|
| + : public BezelController::ScrollDelegate,
|
| + public DragHandle::ScrollDelegate,
|
| + public WindowManagerObserver {
|
| public:
|
| SplitViewController(aura::Window* container,
|
| WindowListProvider* window_list_provider);
|
| @@ -45,12 +59,10 @@ class ATHENA_EXPORT SplitViewController
|
| void ReplaceWindow(aura::Window* window,
|
| aura::Window* replace_with);
|
|
|
| - // Returns the bounds that the left and right windows will have once split
|
| - // view is active and they are done animating. If |left_window_| and
|
| - // |right_window_| are still animating this may be different than their
|
| - // current bounds.
|
| - gfx::Rect GetLeftTargetBounds();
|
| - gfx::Rect GetRightTargetBounds();
|
| + // Returns the bounds of the left and right parts of the |container_| based
|
| + // on the current value of |divider_position_|.
|
| + gfx::Rect GetLeftAreaBounds();
|
| + gfx::Rect GetRightAreaBounds();
|
|
|
| aura::Window* left_window() { return left_window_; }
|
| aura::Window* right_window() { return right_window_; }
|
| @@ -72,10 +84,16 @@ class ATHENA_EXPORT SplitViewController
|
| };
|
|
|
| void SetState(State state);
|
| +
|
| + void InitializeDivider();
|
| + void HideDivider();
|
| + void ShowDivider();
|
| +
|
| void UpdateLayout(bool animate);
|
|
|
| void SetWindowTransforms(const gfx::Transform& left_transform,
|
| const gfx::Transform& right_transform,
|
| + const gfx::Transform& divider_transform,
|
| bool animate);
|
|
|
| // Called when the animation initiated by SetWindowTransforms() completes.
|
| @@ -89,6 +107,18 @@ class ATHENA_EXPORT SplitViewController
|
| virtual void ScrollUpdate(float delta) OVERRIDE;
|
| virtual bool CanScroll() OVERRIDE;
|
|
|
| + // DragHandle::ScrollDelegate:
|
| + virtual void HandleScrollBegin(float delta) OVERRIDE;
|
| + virtual void HandleScrollEnd() OVERRIDE;
|
| + virtual void HandleScrollUpdate(float delta) OVERRIDE;
|
| + virtual bool HandleCanScroll() OVERRIDE;
|
| +
|
| + // WindowManagerObserver:
|
| + virtual void OnOverviewModeEnter() OVERRIDE;
|
| + virtual void OnOverviewModeExit() OVERRIDE;
|
| + virtual void OnSplitViewModeEnter() OVERRIDE;
|
| + virtual void OnSplitViewModeExit() OVERRIDE;
|
| +
|
| State state_;
|
|
|
| aura::Window* container_;
|
| @@ -101,9 +131,14 @@ class ATHENA_EXPORT SplitViewController
|
| aura::Window* left_window_;
|
| aura::Window* right_window_;
|
|
|
| - // Position of the separator between left_window_ and right_window_ in
|
| - // container_ coordinates (along the x axis).
|
| - int separator_position_;
|
| + // X-Coordinate of the (center of the) divider between left_window_ and
|
| + // right_window_ in |container_| coordinates.
|
| + int divider_position_;
|
| +
|
| + scoped_ptr<aura::Window> divider_window_;
|
| + views::Widget* divider_widget_;
|
| +
|
| + scoped_ptr<aura::ScopedWindowTargeter> window_targeter_;
|
|
|
| base::WeakPtrFactory<SplitViewController> weak_factory_;
|
|
|
|
|