widget/windows/winrt/APZController.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #pragma once
michael@0 6
michael@0 7 #include "mozwrlbase.h"
michael@0 8
michael@0 9 #include "mozilla/layers/GeckoContentController.h"
michael@0 10 #include "mozilla/layers/APZCTreeManager.h"
michael@0 11 #include "mozilla/EventForwards.h"
michael@0 12 #include "FrameMetrics.h"
michael@0 13 #include "Units.h"
michael@0 14
michael@0 15 class nsIWidgetListener;
michael@0 16
michael@0 17 namespace mozilla {
michael@0 18 namespace widget {
michael@0 19 namespace winrt {
michael@0 20
michael@0 21 class APZController :
michael@0 22 public mozilla::layers::GeckoContentController
michael@0 23 {
michael@0 24 typedef mozilla::layers::FrameMetrics FrameMetrics;
michael@0 25 typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
michael@0 26 typedef mozilla::layers::ZoomConstraints ZoomConstraints;
michael@0 27
michael@0 28 public:
michael@0 29 APZController() :
michael@0 30 mWidgetListener(nullptr)
michael@0 31 {
michael@0 32 }
michael@0 33
michael@0 34 // GeckoContentController interface
michael@0 35 virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics);
michael@0 36 virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration);
michael@0 37 virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint,
michael@0 38 int32_t aModifiers,
michael@0 39 const mozilla::layers::ScrollableLayerGuid& aGuid);
michael@0 40 virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint,
michael@0 41 int32_t aModifiers,
michael@0 42 const mozilla::layers::ScrollableLayerGuid& aGuid);
michael@0 43 virtual void HandleLongTap(const mozilla::CSSPoint& aPoint,
michael@0 44 int32_t aModifiers,
michael@0 45 const mozilla::layers::ScrollableLayerGuid& aGuid);
michael@0 46 virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint,
michael@0 47 int32_t aModifiers,
michael@0 48 const mozilla::layers::ScrollableLayerGuid& aGuid);
michael@0 49 virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
michael@0 50 virtual void PostDelayedTask(Task* aTask, int aDelayMs);
michael@0 51 virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);
michael@0 52 virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
michael@0 53 APZStateChange aChange,
michael@0 54 int aArg);
michael@0 55
michael@0 56 void SetWidgetListener(nsIWidgetListener* aWidgetListener);
michael@0 57
michael@0 58 bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
michael@0 59 void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
michael@0 60 LayoutDeviceIntPoint* aRefPointOut);
michael@0 61 void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault);
michael@0 62 nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
michael@0 63 ScrollableLayerGuid* aOutTargetGuid);
michael@0 64
michael@0 65 public:
michael@0 66 // todo: make this a member variable as prep for multiple views
michael@0 67 static nsRefPtr<mozilla::layers::APZCTreeManager> sAPZC;
michael@0 68
michael@0 69 private:
michael@0 70 nsIWidgetListener* mWidgetListener;
michael@0 71 };
michael@0 72
michael@0 73 } } }

mercurial