OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return 0; | 154 return 0; |
155 } | 155 } |
156 | 156 |
157 bool Fullscreen::isFullScreen(Document& document) | 157 bool Fullscreen::isFullScreen(Document& document) |
158 { | 158 { |
159 return currentFullScreenElementFrom(document); | 159 return currentFullScreenElementFrom(document); |
160 } | 160 } |
161 | 161 |
162 Fullscreen::Fullscreen(Document& document) | 162 Fullscreen::Fullscreen(Document& document) |
163 : DocumentLifecycleObserver(&document) | 163 : DocumentLifecycleObserver(&document) |
164 , m_areKeysEnabledInFullScreen(false) | |
165 , m_fullScreenRenderer(nullptr) | 164 , m_fullScreenRenderer(nullptr) |
166 , m_eventQueueTimer(this, &Fullscreen::eventQueueTimerFired) | 165 , m_eventQueueTimer(this, &Fullscreen::eventQueueTimerFired) |
167 { | 166 { |
168 document.setHasFullscreenSupplement(); | 167 document.setHasFullscreenSupplement(); |
169 } | 168 } |
170 | 169 |
171 Fullscreen::~Fullscreen() | 170 Fullscreen::~Fullscreen() |
172 { | 171 { |
173 } | 172 } |
174 | 173 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement(), requestType); | 276 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement(), requestType); |
278 enqueueChangeEvent(*currentDoc, requestType); | 277 enqueueChangeEvent(*currentDoc, requestType); |
279 continue; | 278 continue; |
280 } | 279 } |
281 | 280 |
282 // 4. Otherwise, do nothing for this document. It stays the same. | 281 // 4. Otherwise, do nothing for this document. It stays the same. |
283 } while (++current != docs.end()); | 282 } while (++current != docs.end()); |
284 | 283 |
285 // 5. Return, and run the remaining steps asynchronously. | 284 // 5. Return, and run the remaining steps asynchronously. |
286 // 6. Optionally, perform some animation. | 285 // 6. Optionally, perform some animation. |
287 m_areKeysEnabledInFullScreen = requestType != PrefixedMozillaRequest &&
requestType != PrefixedVideoRequest; | |
288 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); | 286 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); |
289 | 287 |
290 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. | 288 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. |
291 return; | 289 return; |
292 } while (0); | 290 } while (0); |
293 | 291 |
294 enqueueErrorEvent(element, requestType); | 292 enqueueErrorEvent(element, requestType); |
295 } | 293 } |
296 | 294 |
297 void Fullscreen::fullyExitFullscreen(Document& document) | 295 void Fullscreen::fullyExitFullscreen(Document& document) |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 if (!m_fullScreenElement) | 450 if (!m_fullScreenElement) |
453 return; | 451 return; |
454 | 452 |
455 if (!document()->isActive()) | 453 if (!document()->isActive()) |
456 return; | 454 return; |
457 | 455 |
458 m_fullScreenElement->willStopBeingFullscreenElement(); | 456 m_fullScreenElement->willStopBeingFullscreenElement(); |
459 | 457 |
460 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 458 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
461 | 459 |
462 m_areKeysEnabledInFullScreen = false; | |
463 | |
464 if (m_fullScreenRenderer) | 460 if (m_fullScreenRenderer) |
465 m_fullScreenRenderer->unwrapRenderer(); | 461 m_fullScreenRenderer->unwrapRenderer(); |
466 | 462 |
467 m_fullScreenElement = nullptr; | 463 m_fullScreenElement = nullptr; |
468 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | 464 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); |
469 | 465 |
470 if (document()->frame()) | 466 if (document()->frame()) |
471 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 467 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
472 | 468 |
473 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means | 469 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void Fullscreen::trace(Visitor* visitor) | 597 void Fullscreen::trace(Visitor* visitor) |
602 { | 598 { |
603 visitor->trace(m_fullScreenElement); | 599 visitor->trace(m_fullScreenElement); |
604 visitor->trace(m_fullScreenElementStack); | 600 visitor->trace(m_fullScreenElementStack); |
605 visitor->trace(m_fullScreenRenderer); | 601 visitor->trace(m_fullScreenRenderer); |
606 visitor->trace(m_eventQueue); | 602 visitor->trace(m_eventQueue); |
607 DocumentSupplement::trace(visitor); | 603 DocumentSupplement::trace(visitor); |
608 } | 604 } |
609 | 605 |
610 } // namespace blink | 606 } // namespace blink |
OLD | NEW |