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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.h

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: alexmos comments addressed Created 3 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999-2001 Lars Knoll <knoll@kde.org> 3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> 4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> 5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org> 6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
9 * reserved. 9 * reserved.
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 FrameClient* Client() const; 92 FrameClient* Client() const;
93 93
94 Page* GetPage() const; // Null when the frame is detached. 94 Page* GetPage() const; // Null when the frame is detached.
95 virtual FrameView* View() const = 0; 95 virtual FrameView* View() const = 0;
96 96
97 bool IsMainFrame() const; 97 bool IsMainFrame() const;
98 bool IsLocalRoot() const; 98 bool IsLocalRoot() const;
99 99
100 FrameOwner* Owner() const; 100 FrameOwner* Owner() const;
101 void SetOwner(FrameOwner* owner) { owner_ = owner; } 101 void SetOwner(FrameOwner*);
102 HTMLFrameOwnerElement* DeprecatedLocalOwner() const; 102 HTMLFrameOwnerElement* DeprecatedLocalOwner() const;
103 103
104 DOMWindow* DomWindow() const { return dom_window_; } 104 DOMWindow* DomWindow() const { return dom_window_; }
105 105
106 FrameTree& Tree() const; 106 FrameTree& Tree() const;
107 ChromeClient& GetChromeClient() const; 107 ChromeClient& GetChromeClient() const;
108 108
109 virtual SecurityContext* GetSecurityContext() const = 0; 109 virtual SecurityContext* GetSecurityContext() const = 0;
110 110
111 Frame* FindUnsafeParentScrollPropagationBoundary(); 111 Frame* FindUnsafeParentScrollPropagationBoundary();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 bool HasReceivedUserGesture() const { return has_received_user_gesture_; } 147 bool HasReceivedUserGesture() const { return has_received_user_gesture_; }
148 148
149 bool IsAttached() const { 149 bool IsAttached() const {
150 return lifecycle_.GetState() == FrameLifecycle::kAttached; 150 return lifecycle_.GetState() == FrameLifecycle::kAttached;
151 } 151 }
152 152
153 // Tests whether the feature-policy controlled feature is enabled by policy in 153 // Tests whether the feature-policy controlled feature is enabled by policy in
154 // the given frame. 154 // the given frame.
155 bool IsFeatureEnabled(WebFeaturePolicyFeature) const; 155 bool IsFeatureEnabled(WebFeaturePolicyFeature) const;
156 156
157 // Called to make a frame inert or non-inert. A frame is inert when there
158 // is a modal dialog displayed within an ancestor frame, and this frame
159 // itself is not within the dialog.
160 virtual void SetIsInert(bool) = 0;
161 void UpdateInertIfPossible();
162
157 protected: 163 protected:
158 Frame(FrameClient*, Page&, FrameOwner*, WindowProxyManager*); 164 Frame(FrameClient*, Page&, FrameOwner*, WindowProxyManager*);
159 165
160 mutable FrameTree tree_node_; 166 mutable FrameTree tree_node_;
161 167
162 Member<Page> page_; 168 Member<Page> page_;
163 Member<FrameOwner> owner_; 169 Member<FrameOwner> owner_;
164 Member<DOMWindow> dom_window_; 170 Member<DOMWindow> dom_window_;
165 171
166 bool has_received_user_gesture_ = false; 172 bool has_received_user_gesture_ = false;
167 173
168 FrameLifecycle lifecycle_; 174 FrameLifecycle lifecycle_;
169 175
176 // This is set to true if this is a subframe, and the frame element in the
177 // parent frame's document becomes inert.
alexmos 2017/06/20 18:46:10 nit: Can we also explicitly say that it is always
kenrb 2017/06/22 15:33:35 Done.
178 bool is_inert_ = false;
179
170 private: 180 private:
171 Member<FrameClient> client_; 181 Member<FrameClient> client_;
172 const Member<WindowProxyManager> window_proxy_manager_; 182 const Member<WindowProxyManager> window_proxy_manager_;
173 // TODO(sashab): Investigate if this can be represented with m_lifecycle. 183 // TODO(sashab): Investigate if this can be represented with m_lifecycle.
174 bool is_loading_; 184 bool is_loading_;
175 }; 185 };
176 186
177 inline FrameClient* Frame::Client() const { 187 inline FrameClient* Frame::Client() const {
178 return client_; 188 return client_;
179 } 189 }
180 190
181 inline FrameOwner* Frame::Owner() const { 191 inline FrameOwner* Frame::Owner() const {
182 return owner_; 192 return owner_;
183 } 193 }
184 194
185 inline FrameTree& Frame::Tree() const { 195 inline FrameTree& Frame::Tree() const {
186 return tree_node_; 196 return tree_node_;
187 } 197 }
188 198
189 // Allow equality comparisons of Frames by reference or pointer, 199 // Allow equality comparisons of Frames by reference or pointer,
190 // interchangeably. 200 // interchangeably.
191 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame) 201 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame)
192 202
193 } // namespace blink 203 } // namespace blink
194 204
195 #endif // Frame_h 205 #endif // Frame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698