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 7ea76c41012e6f2089347baa74d8a6cbacacef90..9e7262dd5b236b79058ba8d2a09899c8837a07e6 100644 |
--- a/ash/wm/workspace/phantom_window_controller.h |
+++ b/ash/wm/workspace/phantom_window_controller.h |
@@ -9,10 +9,12 @@ |
#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
#include "ui/base/animation/animation_delegate.h" |
+#include "ui/gfx/display.h" |
#include "ui/gfx/rect.h" |
namespace aura { |
class Window; |
+class RootWindow; |
} |
namespace ui { |
@@ -30,7 +32,14 @@ namespace internal { |
// of a window. It's used used during dragging a window to show a snap location. |
class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { |
public: |
- explicit PhantomWindowController(aura::Window* window); |
+ enum Style { |
+ STYLE_SHADOW, // for window snapping. |
+ STYLE_WINDOW, // for window dragging. |
+ }; |
+ |
+ PhantomWindowController(aura::Window* window, |
+ aura::RootWindow* root_window, |
+ Style style); |
virtual ~PhantomWindowController(); |
// Bounds last passed to Show(). |
@@ -56,6 +65,14 @@ class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { |
phantom_below_window_ = phantom_below_window; |
} |
+ Style style() const { |
+ return style_; |
+ } |
+ |
+ // Sets/gets the opacity of the phantom window. |
+ void SetOpacity(float opacity); |
+ float GetOpacity() const; |
+ |
// ui::AnimationDelegate overrides: |
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
@@ -63,9 +80,17 @@ class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { |
// Creates and shows the |phantom_widget_| at |bounds|. |
void CreatePhantomWidget(const gfx::Rect& bounds); |
+ // Sets bounds of the phantom window. The window is shown on |dst_display_| |
+ // if its id() is valid. Otherwise, a display nearest to |bounds| is chosen. |
+ void SetBoundsInternal(const gfx::Rect& bounds); |
+ |
// Window the phantom is placed beneath. |
aura::Window* window_; |
+ // The display where the phantom is placed. When dst_display_.id() is -1, a |
+ // display nearest to the current |bounds_| is automatically used. |
+ gfx::Display dst_display_; |
+ |
// If set, the phantom window should get stacked below this window. |
aura::Window* phantom_below_window_; |
@@ -81,6 +106,9 @@ class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { |
// Used to transition the bounds. |
scoped_ptr<ui::SlideAnimation> animation_; |
+ // The style of the phantom window. |
+ Style style_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); |
}; |