| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FullscreenController_h | 31 #ifndef FullscreenController_h |
| 32 #define FullscreenController_h | 32 #define FullscreenController_h |
| 33 | 33 |
| 34 #include "platform/geometry/FloatPoint.h" | 34 #include "platform/geometry/FloatPoint.h" |
| 35 #include "platform/geometry/IntSize.h" | 35 #include "platform/geometry/IntSize.h" |
| 36 #include "wtf/Vector.h" |
| 36 #include <memory> | 37 #include <memory> |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class Element; | 41 class Element; |
| 42 class FullscreenCallbacks; |
| 41 class LocalFrame; | 43 class LocalFrame; |
| 42 class WebViewImpl; | 44 class WebViewImpl; |
| 43 | 45 |
| 44 class FullscreenController { | 46 class FullscreenController { |
| 45 public: | 47 public: |
| 46 static std::unique_ptr<FullscreenController> create(WebViewImpl*); | 48 static std::unique_ptr<FullscreenController> create(WebViewImpl*); |
| 47 | 49 |
| 48 // Called by Fullscreen (via ChromeClient) to request entering or exiting | 50 // Called by Fullscreen (via ChromeClient) to request entering or exiting |
| 49 // fullscreen. | 51 // fullscreen. |
| 50 void enterFullscreen(LocalFrame&); | 52 void enterFullscreen(LocalFrame&, std::unique_ptr<FullscreenCallbacks>); |
| 51 void exitFullscreen(LocalFrame&); | 53 void exitFullscreen(LocalFrame&); |
| 52 | 54 |
| 53 // Called by content::RenderWidget (via WebWidget) to notify that we've | 55 // Called by content::RenderWidget (via WebWidget) to notify that we've |
| 54 // entered or exited fullscreen. This can be because we requested it, or it | 56 // entered or exited fullscreen. This can be because we requested it, or it |
| 55 // can be initiated by the browser directly. | 57 // can be initiated by the browser directly. |
| 56 void didEnterFullscreen(); | 58 void didEnterFullscreen(); |
| 57 void didExitFullscreen(); | 59 void didExitFullscreen(); |
| 58 | 60 |
| 59 // Called by Fullscreen (via ChromeClient) to notify that the fullscreen | 61 // Called by Fullscreen (via ChromeClient) to notify that the fullscreen |
| 60 // element has changed. | 62 // element has changed. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 87 EnteringFullscreen, | 89 EnteringFullscreen, |
| 88 Fullscreen, | 90 Fullscreen, |
| 89 ExitingFullscreen, | 91 ExitingFullscreen, |
| 90 NeedsScrollAndScaleRestore | 92 NeedsScrollAndScaleRestore |
| 91 }; | 93 }; |
| 92 State m_state = State::Initial; | 94 State m_state = State::Initial; |
| 93 | 95 |
| 94 float m_initialPageScaleFactor = 0.0f; | 96 float m_initialPageScaleFactor = 0.0f; |
| 95 IntSize m_initialScrollOffset; | 97 IntSize m_initialScrollOffset; |
| 96 FloatPoint m_initialVisualViewportOffset; | 98 FloatPoint m_initialVisualViewportOffset; |
| 99 |
| 100 using CallbacksList = Vector<std::unique_ptr<FullscreenCallbacks>>; |
| 101 CallbacksList m_callbacksList; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 } // namespace blink | 104 } // namespace blink |
| 100 | 105 |
| 101 #endif | 106 #endif |
| OLD | NEW |