| Index: ash/wm/workspace/phantom_window_controller.cc
|
| diff --git a/ash/wm/workspace/phantom_window_controller.cc b/ash/wm/workspace/phantom_window_controller.cc
|
| index 99861fdb3bd2ff041b58e6622ee95e4d2db97402..656dc698439f1ee19a7f0a367405d7f6cdc05177 100644
|
| --- a/ash/wm/workspace/phantom_window_controller.cc
|
| +++ b/ash/wm/workspace/phantom_window_controller.cc
|
| @@ -72,7 +72,9 @@ class EdgePainter : public views::Painter {
|
| } // namespace
|
|
|
| PhantomWindowController::PhantomWindowController(aura::Window* window)
|
| - : window_(window) {
|
| + : window_(window),
|
| + phantom_below_window_(NULL),
|
| + phantom_widget_(NULL) {
|
| }
|
|
|
| PhantomWindowController::~PhantomWindowController() {
|
| @@ -83,7 +85,7 @@ void PhantomWindowController::Show(const gfx::Rect& bounds) {
|
| if (bounds == bounds_)
|
| return;
|
| bounds_ = bounds;
|
| - if (!phantom_widget_.get()) {
|
| + if (!phantom_widget_) {
|
| // Show the phantom at the bounds of the window. We'll animate to the target
|
| // bounds.
|
| start_bounds_ = window_->GetBoundsInScreen();
|
| @@ -103,11 +105,12 @@ void PhantomWindowController::SetBounds(const gfx::Rect& bounds) {
|
| }
|
|
|
| void PhantomWindowController::Hide() {
|
| - phantom_widget_.reset();
|
| + phantom_widget_->Close();
|
| + phantom_widget_ = NULL;
|
| }
|
|
|
| bool PhantomWindowController::IsShowing() const {
|
| - return phantom_widget_.get() != NULL;
|
| + return phantom_widget_ != NULL;
|
| }
|
|
|
| void PhantomWindowController::AnimationProgressed(
|
| @@ -117,11 +120,10 @@ void PhantomWindowController::AnimationProgressed(
|
| }
|
|
|
| void PhantomWindowController::CreatePhantomWidget(const gfx::Rect& bounds) {
|
| - DCHECK(!phantom_widget_.get());
|
| - phantom_widget_.reset(new views::Widget);
|
| + DCHECK(!phantom_widget_);
|
| + phantom_widget_ = new views::Widget;
|
| views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
|
| params.transparent = true;
|
| - params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
| // PhantomWindowController is used by FrameMaximizeButton to highlight the
|
| // launcher button. Put the phantom in the same window as the launcher so that
|
| // the phantom is visible.
|
| @@ -139,7 +141,10 @@ void PhantomWindowController::CreatePhantomWidget(const gfx::Rect& bounds) {
|
| views::Background::CreateBackgroundPainter(true, new EdgePainter));
|
| phantom_widget_->SetContentsView(content_view);
|
| phantom_widget_->SetBounds(bounds);
|
| - phantom_widget_->StackAbove(window_);
|
| + if (phantom_below_window_)
|
| + phantom_widget_->StackBelow(phantom_below_window_);
|
| + else
|
| + phantom_widget_->StackAbove(window_);
|
| phantom_widget_->Show();
|
| // Fade the window in.
|
| ui::Layer* layer = phantom_widget_->GetNativeWindow()->layer();
|
|
|