Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: third_party/WebKit/Source/core/dom/Fullscreen.h

Issue 2021513002: Move willEnterFullscreen to WebRemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 static bool isActiveFullScreenElement(const Element&); 60 static bool isActiveFullScreenElement(const Element&);
61 61
62 enum RequestType { 62 enum RequestType {
63 // Element.requestFullscreen() 63 // Element.requestFullscreen()
64 UnprefixedRequest, 64 UnprefixedRequest,
65 // Element.webkitRequestFullscreen()/webkitRequestFullScreen() and 65 // Element.webkitRequestFullscreen()/webkitRequestFullScreen() and
66 // HTMLVideoElement.webkitEnterFullscreen()/webkitEnterFullScreen() 66 // HTMLVideoElement.webkitEnterFullscreen()/webkitEnterFullScreen()
67 PrefixedRequest, 67 PrefixedRequest,
68 }; 68 };
69 69
70 void requestFullscreen(Element&, RequestType); 70 // |forCrossProcessAncestor| is used in OOPIF scenarios and is set to true
71 // when fullscreen is requested for an out-of-process descendant element.
72 void requestFullscreen(Element&, RequestType, bool forCrossProcessAncestor = false);
73
71 static void fullyExitFullscreen(Document&); 74 static void fullyExitFullscreen(Document&);
72 void exitFullscreen(); 75 void exitFullscreen();
73 76
74 static bool fullscreenEnabled(Document&); 77 static bool fullscreenEnabled(Document&);
75 Element* fullscreenElement() const { return !m_fullScreenElementStack.isEmpt y() ? m_fullScreenElementStack.last().first.get() : 0; } 78 Element* fullscreenElement() const { return !m_fullScreenElementStack.isEmpt y() ? m_fullScreenElementStack.last().first.get() : 0; }
76 79
77 // |isAncestorOfFullscreenElement| is used in OOPIF scenarios and is set to 80 // |isAncestorOfFullscreenElement| is used in OOPIF scenarios and is set to
78 // true when these functions are called to enter/exit fullscreen for an 81 // true when these functions are called to enter/exit fullscreen for an
79 // out-of-process descendant element. In this case, we enter fullscreen 82 // out-of-process descendant element. In this case, we enter fullscreen
80 // for its (local) iframe container and make sure to also set the 83 // for its (local) iframe container and make sure to also set the
81 // ContainsFullScreenElement flag on it (so that it gains the 84 // ContainsFullScreenElement flag on it (so that it gains the
82 // -webkit-full-screen-ancestor style). 85 // -webkit-full-screen-ancestor style).
83 void didEnterFullScreenForElement(Element*, bool isAncestorOfFullscreenEleme nt); 86 void didEnterFullScreenForElement(Element*);
84 void didExitFullScreenForElement(bool isAncestorOfFullscreenElement); 87 void didExitFullScreenForElement();
85 88
86 void setFullScreenLayoutObject(LayoutFullScreen*); 89 void setFullScreenLayoutObject(LayoutFullScreen*);
87 LayoutFullScreen* fullScreenLayoutObject() const { return m_fullScreenLayout Object; } 90 LayoutFullScreen* fullScreenLayoutObject() const { return m_fullScreenLayout Object; }
88 void fullScreenLayoutObjectDestroyed(); 91 void fullScreenLayoutObjectDestroyed();
89 92
90 void elementRemoved(Element&); 93 void elementRemoved(Element&);
91 94
95 // Returns true if the current fullscreen element stack corresponds to a
96 // container for an actual fullscreen element in an out-of-process iframe.
97 bool forCrossProcessAncestor() { return m_forCrossProcessAncestor; }
98
92 // Mozilla API 99 // Mozilla API
93 Element* webkitCurrentFullScreenElement() const { return m_fullScreenElement .get(); } 100 Element* webkitCurrentFullScreenElement() const { return m_fullScreenElement .get(); }
94 101
95 // ContextLifecycleObserver: 102 // ContextLifecycleObserver:
96 void contextDestroyed() override; 103 void contextDestroyed() override;
97 104
98 DECLARE_VIRTUAL_TRACE(); 105 DECLARE_VIRTUAL_TRACE();
99 106
100 private: 107 private:
101 static Fullscreen* fromIfExistsSlow(Document&); 108 static Fullscreen* fromIfExistsSlow(Document&);
(...skipping 10 matching lines...) Expand all
112 void enqueueErrorEvent(Element&, RequestType); 119 void enqueueErrorEvent(Element&, RequestType);
113 void eventQueueTimerFired(Timer<Fullscreen>*); 120 void eventQueueTimerFired(Timer<Fullscreen>*);
114 121
115 Member<Element> m_fullScreenElement; 122 Member<Element> m_fullScreenElement;
116 HeapVector<std::pair<Member<Element>, RequestType>> m_fullScreenElementStack ; 123 HeapVector<std::pair<Member<Element>, RequestType>> m_fullScreenElementStack ;
117 LayoutFullScreen* m_fullScreenLayoutObject; 124 LayoutFullScreen* m_fullScreenLayoutObject;
118 Timer<Fullscreen> m_eventQueueTimer; 125 Timer<Fullscreen> m_eventQueueTimer;
119 HeapDeque<Member<Event>> m_eventQueue; 126 HeapDeque<Member<Event>> m_eventQueue;
120 LayoutRect m_savedPlaceholderFrameRect; 127 LayoutRect m_savedPlaceholderFrameRect;
121 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle; 128 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle;
129 bool m_forCrossProcessAncestor;
alexmos 2016/05/27 21:14:29 I thought about whether we need to maintain this o
dcheng 2016/05/28 19:59:10 How does this interact with multimonitor though?
alexmos 2016/05/31 16:56:25 I don't think that affects it. As part of HTML fu
dcheng 2016/05/31 17:50:23 What if you fullcsreen on your secondary monitor a
alexmos 2016/05/31 18:08:17 You can't drag the browser window onto the primary
dcheng 2016/05/31 18:50:18 What happens if we fix https://crbug.com/161068 so
alexmos 2016/05/31 23:35:18 Hmm, that's a really good point, I didn't realize
dcheng 2016/06/01 00:29:36 sgtm. we might want to make a note on the fullscre
alexmos 2016/06/01 16:50:13 Done. I'll add a note to the bug when this lands.
122 }; 130 };
123 131
124 inline bool Fullscreen::isActiveFullScreenElement(const Element& element) 132 inline bool Fullscreen::isActiveFullScreenElement(const Element& element)
125 { 133 {
126 Fullscreen* fullscreen = fromIfExists(element.document()); 134 Fullscreen* fullscreen = fromIfExists(element.document());
127 if (!fullscreen) 135 if (!fullscreen)
128 return false; 136 return false;
129 return fullscreen->webkitCurrentFullScreenElement() == &element; 137 return fullscreen->webkitCurrentFullScreenElement() == &element;
130 } 138 }
131 139
132 inline Fullscreen* Fullscreen::fromIfExists(Document& document) 140 inline Fullscreen* Fullscreen::fromIfExists(Document& document)
133 { 141 {
134 if (!document.hasFullscreenSupplement()) 142 if (!document.hasFullscreenSupplement())
135 return 0; 143 return 0;
136 return fromIfExistsSlow(document); 144 return fromIfExistsSlow(document);
137 } 145 }
138 146
139 } // namespace blink 147 } // namespace blink
140 148
141 #endif // Fullscreen_h 149 #endif // Fullscreen_h
OLDNEW
« no previous file with comments | « content/renderer/render_frame_proxy.cc ('k') | third_party/WebKit/Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698