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

Unified Diff: ash/common/wm/overview/scoped_transform_overview_window.h

Issue 2470343003: Use mirror layer for minimized windows in overview mode (Closed)
Patch Set: Use mirror layer for minimized windows in overview mode Created 4 years, 1 month 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
« no previous file with comments | « no previous file | ash/common/wm/overview/scoped_transform_overview_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/scoped_transform_overview_window.h
diff --git a/ash/common/wm/overview/scoped_transform_overview_window.h b/ash/common/wm/overview/scoped_transform_overview_window.h
index 253378cd7d6ccf630c0947f9abcd47c70f43eac1..9514d34b159db83e7f5ce6a28bd918ddbad857f2 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.h
+++ b/ash/common/wm/overview/scoped_transform_overview_window.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/events/event_handler.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/transform.h"
@@ -22,6 +23,10 @@ namespace gfx {
class Rect;
}
+namespace views {
+class Widget;
+}
+
namespace ash {
class ScopedOverviewAnimationSettings;
@@ -31,7 +36,7 @@ class WmWindow;
// class allows transforming the windows with a helper to determine the best
// fit in certain bounds. The window's state is restored on destruction of this
// object.
-class ASH_EXPORT ScopedTransformOverviewWindow {
+class ASH_EXPORT ScopedTransformOverviewWindow : public ui::EventHandler {
public:
class OverviewContentMask;
using ScopedAnimationSettings =
@@ -59,7 +64,7 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
const gfx::Rect& dst_rect);
explicit ScopedTransformOverviewWindow(WmWindow* window);
- ~ScopedTransformOverviewWindow();
+ ~ScopedTransformOverviewWindow() override;
// Starts an animation sequence which will use animation settings specified by
// |animation_type|. The |animation_settings| container is populated with
@@ -103,10 +108,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// Restores and animates the managed window to it's non overview mode state.
void RestoreWindow();
- // Forces the managed window to be shown (ie not hidden or minimized) when
- // calling RestoreWindow().
- void ShowWindowOnExit();
-
// Informs the ScopedTransformOverviewWindow that the window being watched was
// destroyed. This resets the internal window pointer.
void OnWindowDestroyed();
@@ -128,26 +129,34 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// Shows the window header that is hidden by HideHeader().
void ShowHeader();
+ // Creates/Deletes a mirror window for minimized windows.
+ void UpdateMirrorWindowForMinimizedState();
+
WmWindow* window() const { return window_; }
// Closes the transient root of the window managed by |this|.
void Close();
- private:
- friend class WindowSelectorTest;
+ // Returns the window used to show the content in overview mdoe.
+ // For minmiezd window, this will be a window that hosts mirrored layers.
+ WmWindow* GetOverviewWindow() const;
- enum OriginalVisibility {
- ORIGINALLY_VISIBLE,
- ORIGINALLY_MINIMIZED,
- ORIGINALLY_DOCKED_MINIMIZED,
- };
+ // Returns the window created for minimized window, or nullptr
+ // if it does not exit.
+ WmWindow* GetOverviewWindowForMinimizedState() const;
- // Shows the window if it was minimized.
- void ShowWindowIfMinimized();
+ // ui::EventHandler:
+ void OnGestureEvent(ui::GestureEvent* event) override;
+ void OnMouseEvent(ui::MouseEvent* event) override;
+
+ private:
+ friend class WindowSelectorTest;
// Closes the window managed by |this|.
void CloseWidget();
+ void CreateMirrorWindowForMinimizedState();
+
// Makes Close() execute synchronously when used in tests.
static void SetImmediateCloseForTests();
@@ -161,10 +170,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// been determined that window shape was not originally set on the |window_|.
bool determined_original_window_shape_;
- // Original visibility of |window_| upon entering overview mode that needs to
- // be restored unless the window gets selected.
- OriginalVisibility original_visibility_;
-
// Tracks if this window was ignored by the shelf.
bool ignored_by_shelf_;
@@ -174,8 +179,8 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// The original transform of the window before entering overview mode.
gfx::Transform original_transform_;
- // The original opacity of the window before entering overview mode.
- float original_opacity_;
+ // A window that holds the content for minimized window.
+ std::unique_ptr<views::Widget> minimized_widget_;
base::WeakPtrFactory<ScopedTransformOverviewWindow> weak_ptr_factory_;
« no previous file with comments | « no previous file | ash/common/wm/overview/scoped_transform_overview_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698