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

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

Issue 2918403006: CrOS Tablet Window management - Split Screen part I (Closed)
Patch Set: Address varkha@'s comments. 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/window_selector_item.h
diff --git a/ash/wm/overview/window_selector_item.h b/ash/wm/overview/window_selector_item.h
index 6e77d73f8beff17812b244910bc405040c72af2f..e04b547e08005e5da6de5ae6f444552fdc8b5399 100644
--- a/ash/wm/overview/window_selector_item.h
+++ b/ash/wm/overview/window_selector_item.h
@@ -29,6 +29,7 @@ class ImageButton;
namespace ash {
class WindowSelector;
+class WindowGrid;
// This class represents an item in overview mode.
class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
@@ -47,7 +48,9 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton);
};
- WindowSelectorItem(aura::Window* window, WindowSelector* window_selector);
+ WindowSelectorItem(aura::Window* window,
+ WindowSelector* window_selector,
+ WindowGrid* window_grid);
~WindowSelectorItem() override;
aura::Window* GetWindow();
@@ -120,6 +123,11 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
void OnWindowDestroying(aura::Window* window) override;
void OnWindowTitleChanged(aura::Window* window) override;
+ // Handle the mouse/gesture event and facilitate dragging the item.
+ void HandlePressEvent(const gfx::Point& location_in_screen);
+ void HandleReleaseEvent(const gfx::Point& location_in_screen);
+ void HandleDragEvent(const gfx::Point& location_in_screen);
+
private:
class CaptionContainerView;
class RoundedContainerView;
@@ -166,6 +174,15 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
aura::Window* GetOverviewWindowForMinimizedStateForTest();
+ // Called before dragging. Scales up the window a little bit to indicate its
+ // selection and stacks the window at the top of the Z order in order to keep
+ // it visible while dragging around.
+ void StartDrag();
+
+ // Called after dragging. Inserts the window back to its original stack order
+ // so that the windows orders are the same as when they entering overview.
varkha 2017/06/26 16:40:08 nit (I think): the windows are ordered in the same
xdai1 2017/06/26 21:44:00 Done.
+ void EndDrag();
+
// True if the item is being shown in the overview, false if it's being
// filtered.
bool dimmed_;
@@ -215,6 +232,10 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// which is the only textured layer used by the |item_widget_|.
RoundedContainerView* background_view_;
+ // Pointer to the WindowGrid that contains |this|. Guaranteed to be non-null
+ // for the lifetime of |this|.
+ WindowGrid* window_grid_;
+
DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
};

Powered by Google App Engine
This is Rietveld 408576698