Index: third_party/WebKit/Source/web/FullscreenController.h |
diff --git a/third_party/WebKit/Source/web/FullscreenController.h b/third_party/WebKit/Source/web/FullscreenController.h |
index 3250456888119ef5a3bfb6bdcb77d4bd6de01a26..fdf2a545fc8c02d4e27195ba9070c39104e1b6af 100644 |
--- a/third_party/WebKit/Source/web/FullscreenController.h |
+++ b/third_party/WebKit/Source/web/FullscreenController.h |
@@ -33,8 +33,7 @@ |
#include "platform/geometry/FloatPoint.h" |
#include "platform/geometry/IntSize.h" |
-#include "platform/heap/Handle.h" |
-#include "wtf/RefPtr.h" |
+#include <memory> |
namespace blink { |
@@ -42,15 +41,14 @@ class Element; |
class LocalFrame; |
class WebViewImpl; |
-class FullscreenController final |
- : public GarbageCollected<FullscreenController> { |
+class FullscreenController { |
public: |
- static FullscreenController* create(WebViewImpl*); |
+ static std::unique_ptr<FullscreenController> create(WebViewImpl*); |
// Called by Fullscreen (via ChromeClient) to request entering or exiting |
// fullscreen. |
- void enterFullscreenForElement(Element*); |
- void exitFullscreen(LocalFrame*); |
+ void enterFullscreen(LocalFrame&); |
+ void exitFullscreen(LocalFrame&); |
// Called by content::RenderWidget (via WebWidget) to notify that we've |
// entered or exited fullscreen. This can be because we requested it, or it |
@@ -62,14 +60,12 @@ class FullscreenController final |
// element has changed. |
void fullscreenElementChanged(Element*, Element*); |
- bool isFullscreen() { return m_fullscreenFrame; } |
+ bool isFullscreen() { return m_state == State::Fullscreen; } |
void updateSize(); |
void didUpdateLayout(); |
- DECLARE_TRACE(); |
- |
protected: |
explicit FullscreenController(WebViewImpl*); |
@@ -78,19 +74,18 @@ class FullscreenController final |
WebViewImpl* m_webViewImpl; |
- bool m_haveEnteredFullscreen; |
- float m_exitFullscreenPageScaleFactor; |
- IntSize m_exitFullscreenScrollOffset; |
- FloatPoint m_exitFullscreenVisualViewportOffset; |
- bool m_needsScrollAndScaleRestore; |
- |
- // If set, the WebView is transitioning to fullscreen for this element. |
- Member<Element> m_provisionalFullscreenElement; |
- |
- // If set, the WebView is in fullscreen mode for an element in this frame. |
- Member<LocalFrame> m_fullscreenFrame; |
- |
- bool m_isCancelingFullscreen; |
+ enum class State { |
+ Initial, |
mlamouri (slow - plz ping)
2016/12/05 13:54:54
Is `Initial` used after exiting fullscreen scroll
foolip
2016/12/06 11:31:39
I have added a documentation block, can you take a
|
+ EnteringFullscreen, |
+ Fullscreen, |
+ ExitingFullscreen, |
+ NeedsScrollAndScaleRestore |
mlamouri (slow - plz ping)
2016/12/05 13:54:54
Add a comment explaining what that means?
|
+ }; |
+ State m_state = State::Initial; |
+ |
+ float m_initialPageScaleFactor = 0.0f; |
+ IntSize m_initialScrollOffset; |
+ FloatPoint m_initialVisualViewportOffset; |
}; |
} // namespace blink |