Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3764)

Unified Diff: athena/wm/split_view_controller.h

Issue 420603011: Split Screen mode implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_view
Patch Set: Fixing a rebase glitch Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: athena/wm/split_view_controller.h
diff --git a/athena/wm/split_view_controller.h b/athena/wm/split_view_controller.h
index e0652def1b19050b568964926916aee06aac731f..ca4fc8a5d5f0b60bf327a9382a0bf60cb6964d0e 100644
--- a/athena/wm/split_view_controller.h
+++ b/athena/wm/split_view_controller.h
@@ -6,24 +6,95 @@
#define ATHENA_WM_SPLIT_VIEW_CONTROLLER_H_
#include "athena/wm/bezel_controller.h"
+#include "athena/wm/public/window_manager_observer.h"
+#include "athena/wm/window_overview_mode.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+
+namespace gfx {
+class Transform;
+}
namespace athena {
+class WindowListProvider;
+class WindowManager;
+class WindowOverviewModeDelegate;
// Responsible for entering split view mode, exiting from split view mode, and
// laying out the windows in split view mode.
-class SplitViewController : public BezelController::ScrollDelegate {
+class SplitViewController : public BezelController::ScrollDelegate,
+ public WindowManagerObserver {
public:
- SplitViewController();
+ SplitViewController(aura::Window* container,
+ WindowListProvider* window_list_provider,
+ WindowManager* window_manager);
+
virtual ~SplitViewController();
+ bool IsSplitViewModeActive() const;
+
private:
+ enum State {
+ // Split View mode is not active. |left_window_| and |right_window| are
+ // NULL.
+ INACTIVE,
+ // Two windows |left_window_| and |right_window| are shown side by side and
+ // there is a horizontal scroll in progress which is dragging the separator
+ // between the two windows.
+ SCROLLING,
+ // Split View mode is active with |left_window_| and |right_window| showing
+ // side by side each occupying half the screen. No scroll in progress.
+ ACTIVE
+ };
+
+ void UpdateLayout(bool animate);
+
+ void SetWindowTransform(aura::Window* left_window,
+ const gfx::Transform& transform,
+ bool animate);
+
+ void OnAnimationCompleted(aura::Window* window);
+
+ void UpdateSeparatorPositionFromScrollDelta(float delta);
+
+ // Returns the current activity shown to the user. Persists through the
+ // SCROLLING and ACTIVE states and gets updated if the current activity goes
+ // off screen when the user switches between activities.
+ aura::Window* GetCurrentActivityWindow();
+
// BezelController::ScrollDelegate overrides.
virtual void ScrollBegin(BezelController::Bezel bezel, float delta) OVERRIDE;
virtual void ScrollEnd() OVERRIDE;
virtual void ScrollUpdate(float delta) OVERRIDE;
virtual bool CanScroll() OVERRIDE;
+ // WindowManagerObserver
+ virtual void OnOverviewModeEnter() OVERRIDE;
+ virtual void OnOverviewModeExit() OVERRIDE;
+
+ base::WeakPtrFactory<SplitViewController> weak_factory_;
sadrul 2014/08/09 13:32:40 This should be the last member variable. (see http
mfomitchev 2014/08/09 18:29:56 Done, good to know, thanks for pointing this out.
+
+ State state_;
+
+ aura::Window* container_;
+ WindowManager* window_manager_;
+ // Provider of the list of windows to cycle through. Not owned.
+ WindowListProvider* window_list_provider_;
+
+ // Keeps track of the current activity shown as the user switches between
+ // activities. Persists through the SCROLLING and ACTIVE states. Gets reset
+ // to NULL when overview mode is activated.
+ aura::Window* current_activity_window_;
+
+ // Windows for the left and right activities shown in SCROLLING and ACTIVE
+ // states. In INACTIVE state these are NULL.
+ 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_;
+
DISALLOW_COPY_AND_ASSIGN(SplitViewController);
};

Powered by Google App Engine
This is Rietveld 408576698