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

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

Issue 2101843003: [ash-md] Animates a window closed while in overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Animates a window closed while in overview mode (comments) Created 4 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/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 4344e1bc42f3f55ff66f22b828745e469ee9f279..7445d763f4097810fc76ba9706b1b64937c2522e 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.h
+++ b/ash/common/wm/overview/scoped_transform_overview_window.h
@@ -11,6 +11,7 @@
#include "ash/ash_export.h"
#include "ash/common/wm/overview/overview_animation_type.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/transform.h"
@@ -116,11 +117,18 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
void Close();
private:
+ friend class WindowSelectorTest;
class OverviewContentMask;
// Shows the window if it was minimized.
void ShowWindowIfMinimized();
+ // Closes the window managed by |this|.
+ void CloseWidget();
+
+ // Makes Close() execute synchronously when used in tests.
+ static void SetImmediateCloseForTests();
+
// A weak pointer to the real window in the overview.
WmWindow* window_;
@@ -147,6 +155,8 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// The original opacity of the window before entering overview mode.
float original_opacity_;
+ base::WeakPtrFactory<ScopedTransformOverviewWindow> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow);
};

Powered by Google App Engine
This is Rietveld 408576698