diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index 004fa818bfa..16e9beb8d82 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -77,7 +77,7 @@ SelectionCarets::SelectionCarets(nsIPresShell* aPresShell) , mActiveTouchId(-1) , mCaretCenterToDownPointOffsetY(0) , mDragMode(NONE) - , mUseAsyncPanZoom(false) + , mAsyncPanZoomEnabled(false) , mInAsyncPanZoomGesture(false) , mEndCaretVisible(false) , mStartCaretVisible(false) @@ -113,10 +113,8 @@ SelectionCarets::Init() return; } -#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) - docShell->GetAsyncPanZoomEnabled(&mUseAsyncPanZoom); - mUseAsyncPanZoom = mUseAsyncPanZoom && gfxPrefs::AsyncPanZoomEnabled(); -#endif + docShell->GetAsyncPanZoomEnabled(&mAsyncPanZoomEnabled); + mAsyncPanZoomEnabled = mAsyncPanZoomEnabled && gfxPrefs::AsyncPanZoomEnabled(); docShell->AddWeakReflowObserver(this); docShell->AddWeakScrollObserver(this); @@ -1191,7 +1189,7 @@ void SelectionCarets::ScrollPositionChanged() { if (mVisible) { - if (!mUseAsyncPanZoom) { + if (!mAsyncPanZoomEnabled) { SetVisibility(false); //TODO: handling scrolling for selection bubble when APZ is off @@ -1216,7 +1214,7 @@ SelectionCarets::ScrollPositionChanged() void SelectionCarets::LaunchLongTapDetector() { - if (mUseAsyncPanZoom) { + if (mAsyncPanZoomEnabled) { return; } @@ -1238,7 +1236,7 @@ SelectionCarets::LaunchLongTapDetector() void SelectionCarets::CancelLongTapDetector() { - if (mUseAsyncPanZoom) { + if (mAsyncPanZoomEnabled) { return; } diff --git a/layout/base/SelectionCarets.h b/layout/base/SelectionCarets.h index 1504bdb5fd8..3d707605b4e 100644 --- a/layout/base/SelectionCarets.h +++ b/layout/base/SelectionCarets.h @@ -258,8 +258,8 @@ private: DragMode mDragMode; - // True if async-pan-zoom should be used for selection carets. - bool mUseAsyncPanZoom; + // True if AsyncPanZoom is enabled + bool mAsyncPanZoomEnabled; // True if AsyncPanZoom is started bool mInAsyncPanZoomGesture;