Index: ash/wm/gestures/system_pinch_handler.cc |
diff --git a/ash/wm/gestures/system_pinch_handler.cc b/ash/wm/gestures/system_pinch_handler.cc |
index 83511a6471a66c07b16346feedf00f0539e11a06..981dc24a77e0b50a7e17108e48ffd11936e60909 100644 |
--- a/ash/wm/gestures/system_pinch_handler.cc |
+++ b/ash/wm/gestures/system_pinch_handler.cc |
@@ -30,7 +30,6 @@ const int SystemPinchHandler::kSystemGesturePoints = 4; |
SystemPinchHandler::SystemPinchHandler(aura::Window* target) |
: target_(target), |
- phantom_(target), |
phantom_state_(PHANTOM_WINDOW_NORMAL), |
pinch_factor_(1.) { |
widget_ = views::Widget::GetWidgetForNativeWindow(target_); |
@@ -72,13 +71,16 @@ SystemGestureStatus SystemPinchHandler::ProcessGestureEvent( |
pinch_factor_ *= event.details().scale(); |
gfx::Rect bounds = |
GetPhantomWindowScreenBounds(target_, event.location()); |
- if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing()) |
- phantom_.Show(bounds); |
+ if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.get()) { |
+ if (!phantom_.get()) |
+ phantom_.reset(new internal::PhantomWindowController(target_)); |
+ phantom_->Show(bounds); |
+ } |
break; |
} |
case ui::ET_GESTURE_MULTIFINGER_SWIPE: { |
- phantom_.Hide(); |
+ phantom_.reset(); |
pinch_factor_ = 1.0; |
phantom_state_ = PHANTOM_WINDOW_NORMAL; |