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

Unified Diff: ash/wm/gestures/system_pinch_handler.cc

Issue 101773004: Refactor PhantomWindowController so that the PhantomWindowController owns the phantom window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « ash/wm/gestures/system_pinch_handler.h ('k') | ash/wm/workspace/phantom_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ash/wm/gestures/system_pinch_handler.h ('k') | ash/wm/workspace/phantom_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698