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

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

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 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 bool Frame::IsFeatureEnabled(WebFeaturePolicyFeature feature) const { 186 bool Frame::IsFeatureEnabled(WebFeaturePolicyFeature feature) const {
187 WebFeaturePolicy* feature_policy = GetSecurityContext()->GetFeaturePolicy(); 187 WebFeaturePolicy* feature_policy = GetSecurityContext()->GetFeaturePolicy();
188 // The policy should always be initialized before checking it to ensure we 188 // The policy should always be initialized before checking it to ensure we
189 // properly inherit the parent policy. 189 // properly inherit the parent policy.
190 DCHECK(feature_policy); 190 DCHECK(feature_policy);
191 191
192 // Otherwise, check policy. 192 // Otherwise, check policy.
193 return feature_policy->IsFeatureEnabled(feature); 193 return feature_policy->IsFeatureEnabled(feature);
194 } 194 }
195 195
196 void Frame::SetOwner(FrameOwner* owner) {
197 owner_ = owner;
198 UpdateInertIfPossible();
199 }
200
201 void Frame::UpdateInertIfPossible() {
202 if (owner_ && owner_->IsLocal()) {
203 ToHTMLFrameOwnerElement(owner_)->UpdateDistribution();
204 if (ToHTMLFrameOwnerElement(owner_)->IsInert())
205 SetIsInert(true);
206 }
207 }
208
196 Frame::Frame(FrameClient* client, 209 Frame::Frame(FrameClient* client,
197 Page& page, 210 Page& page,
198 FrameOwner* owner, 211 FrameOwner* owner,
199 WindowProxyManager* window_proxy_manager) 212 WindowProxyManager* window_proxy_manager)
200 : tree_node_(this), 213 : tree_node_(this),
201 page_(&page), 214 page_(&page),
202 owner_(owner), 215 owner_(owner),
203 client_(client), 216 client_(client),
204 window_proxy_manager_(window_proxy_manager), 217 window_proxy_manager_(window_proxy_manager),
205 is_loading_(false) { 218 is_loading_(false) {
206 InstanceCounters::IncrementCounter(InstanceCounters::kFrameCounter); 219 InstanceCounters::IncrementCounter(InstanceCounters::kFrameCounter);
207 220
208 if (owner_) 221 if (owner_)
209 owner_->SetContentFrame(*this); 222 owner_->SetContentFrame(*this);
210 else 223 else
211 page_->SetMainFrame(this); 224 page_->SetMainFrame(this);
212 } 225 }
213 226
214 } // namespace blink 227 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698