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

Unified Diff: ash/wm/overview/overview_window_drag_controller.h

Issue 2918403006: CrOS Tablet Window management - Split Screen part I (Closed)
Patch Set: Fix failed tests. Created 3 years, 6 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: ash/wm/overview/overview_window_drag_controller.h
diff --git a/ash/wm/overview/overview_window_drag_controller.h b/ash/wm/overview/overview_window_drag_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c84f5366a0bef5d2f0791a8729698e31c74a430
--- /dev/null
+++ b/ash/wm/overview/overview_window_drag_controller.h
@@ -0,0 +1,70 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_OVERVIEW_OVERVIEW_WINDOW_DRAG_CONTROLLER_H_
+#define ASH_WM_OVERVIEW_OVERVIEW_WINDOW_DRAG_CONTROLLER_H_
+
+#include <memory>
+
+#include "ash/ash_export.h"
+#include "base/macros.h"
+#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace ash {
+
+class WindowSelector;
+class WindowSelectorItem;
+class PhantomWindowController;
+class SplitViewController;
+
+// The drag controller for an overview window item in overview mode. It updates
+// the position of the corresponding window item while dragging and shows/hides
oshima 2017/06/14 00:19:27 update the position using transform?
xdai1 2017/06/15 22:11:41 Done.
+// the phantom window accordingly.
+class ASH_EXPORT OverviewWindowDragController {
+ public:
+ enum SnapType { SNAP_LEFT, SNAP_RIGHT, SNAP_NONE };
oshima 2017/06/14 00:19:27 does this have to be public?
xdai1 2017/06/15 22:11:41 You're right. Not necessarily. Moved to private.
+
+ OverviewWindowDragController(WindowSelector* window_selector);
oshima 2017/06/14 00:19:27 explicit
xdai1 2017/06/15 22:11:41 Done.
+ ~OverviewWindowDragController();
+
+ void InitiateDrag(WindowSelectorItem* item,
+ const gfx::Point& location_in_screen);
+ void Drag(WindowSelectorItem* item, const gfx::Point& location_in_screen);
+ void CompleteDrag(WindowSelectorItem* item);
+
+ private:
+ void UpdatePhantomWindow(const gfx::Point& location_in_screen);
+ SnapType GetSnapType(const gfx::Point& location_in_screen);
+
+ void SnapToLeft();
+ void SnapToRight();
+
+ WindowSelector* window_selector_;
+
+ SplitViewController* split_view_controller_;
+
+ // Gives a previews of where the dragged window will end up.
+ std::unique_ptr<PhantomWindowController> phantom_window_controller_;
+
+ // The drag target window in the overview mode.
+ WindowSelectorItem* item_ = nullptr;
+
+ // The location of the initial mouse/touch/gesture event in screen.
+ gfx::Point initial_event_location_;
+
+ // The location of the previous mouse/touch/gesture event in screen.
+ gfx::Point previous_event_location_;
+
+ // Set to true once the bounds of |item_| changes.
+ bool did_move_ = false;
+
+ SnapType snap_type_ = SNAP_NONE;
+
+ DISALLOW_COPY_AND_ASSIGN(OverviewWindowDragController);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_DRAG_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698