Index: ash/wm/workspace/phantom_window_controller.h |
diff --git a/ash/wm/workspace/phantom_window_controller.h b/ash/wm/workspace/phantom_window_controller.h |
index 77d4a2860353a0393c0d703f8c09187f4c3788ba..e2acc6ff8101c3bc043bb78acb03331bc6a48e68 100644 |
--- a/ash/wm/workspace/phantom_window_controller.h |
+++ b/ash/wm/workspace/phantom_window_controller.h |
@@ -9,17 +9,12 @@ |
#include "base/basictypes.h" |
#include "base/gtest_prod_util.h" |
#include "base/memory/scoped_ptr.h" |
-#include "ui/gfx/animation/animation_delegate.h" |
#include "ui/gfx/rect.h" |
namespace aura { |
class Window; |
} |
-namespace gfx { |
-class SlideAnimation; |
-} |
- |
namespace views { |
class Widget; |
} |
@@ -28,14 +23,14 @@ namespace ash { |
namespace internal { |
// PhantomWindowController is responsible for showing a phantom representation |
-// of a window. It's used used during dragging a window to show a snap location. |
-class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate { |
+// of a window. It's used used to show a preview of how snapping or docking a |
+// window will affect the window's bounds. |
+class ASH_EXPORT PhantomWindowController { |
public: |
explicit PhantomWindowController(aura::Window* window); |
- virtual ~PhantomWindowController(); |
- // Bounds last passed to Show(). |
- const gfx::Rect& bounds_in_screen() const { return bounds_in_screen_; } |
+ // Hides the phantom window immediately. |
+ virtual ~PhantomWindowController(); |
// Animates the phantom window towards |bounds_in_screen|. |
// Creates two (if start bounds intersect any root window other than the |
@@ -44,7 +39,10 @@ class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate { |
// This does not immediately show the window. |
void Show(const gfx::Rect& bounds_in_screen); |
- // Hides the phantom. |
+ // Starts fading out the phantom window. |
+ void StartFadeOut(); |
+ |
+ // Hides the phantom window without any animation. |
void Hide(); |
// Returns true if the phantom is showing. |
@@ -56,16 +54,18 @@ class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate { |
phantom_below_window_ = phantom_below_window; |
} |
- // gfx::AnimationDelegate overrides: |
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
- |
private: |
FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, PhantomWindowShow); |
// Creates, shows and returns a phantom widget at |bounds| |
- // with kShellWindowId_ShelfContainer in |root_window| as a parent. |
- views::Widget* CreatePhantomWidget(aura::Window* root_window, |
- const gfx::Rect& bounds_in_screen); |
+ // with kShellWindowId_ShelfContainer in |root_window| as a parent. The caller |
+ // takes ownership of the returned widget. |
+ views::Widget* CreatePhantomWidget( |
+ aura::Window* root_window, |
+ const gfx::Rect& bounds_in_screen) WARN_UNUSED_RESULT; |
+ |
+ // Starts fading the phantom window in or out. |
+ void StartFade(bool fade_in); |
// Window the phantom is placed beneath. |
aura::Window* window_; |
@@ -73,26 +73,20 @@ class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate { |
// If set, the phantom window should get stacked below this window. |
aura::Window* phantom_below_window_; |
- // Initially the bounds of |window_| (in screen coordinates). |
- // Each time Show() is invoked |start_bounds_| is then reset to the bounds of |
- // |phantom_widget_| and |bounds_| is set to the value passed into Show(). |
- // The animation animates between these two values. |
- gfx::Rect start_bounds_; |
+ // Target visibility of the animation. |
+ bool target_visibility_; |
// Target bounds of the animation in screen coordinates. |
- gfx::Rect bounds_in_screen_; |
+ gfx::Rect target_bounds_in_screen_; |
// The primary phantom representation of the window. It is parented by the |
// root window matching the target bounds. |
- views::Widget* phantom_widget_; |
+ scoped_ptr<views::Widget> phantom_widget_; |
// If the animation starts on another display, this is the secondary phantom |
// representation of the window used on the initial display, otherwise this is |
// NULL. This allows animation to progress from one display into the other. |
Mr4D (OOO till 08-26)
2013/12/17 22:55:20
Somehow the name is ... odd. What about naming one
|
- views::Widget* phantom_widget_start_; |
- |
- // Used to transition the bounds. |
- scoped_ptr<gfx::SlideAnimation> animation_; |
+ scoped_ptr<views::Widget> phantom_widget_start_; |
DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); |
}; |