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

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

Issue 2730303002: Move Feature Policy test to Frame (Closed)
Patch Set: Fix rebase Created 3 years, 9 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 for (size_t i = 0; i < childFrames.size(); ++i) 395 for (size_t i = 0; i < childFrames.size(); ++i)
396 childFrames[i]->didChangeVisibilityState(); 396 childFrames[i]->didChangeVisibilityState();
397 } 397 }
398 398
399 void Frame::setDocumentHasReceivedUserGesture() { 399 void Frame::setDocumentHasReceivedUserGesture() {
400 m_hasReceivedUserGesture = true; 400 m_hasReceivedUserGesture = true;
401 if (Frame* parent = tree().parent()) 401 if (Frame* parent = tree().parent())
402 parent->setDocumentHasReceivedUserGesture(); 402 parent->setDocumentHasReceivedUserGesture();
403 } 403 }
404 404
405 bool Frame::isFeatureEnabled(WebFeaturePolicyFeature feature) const {
406 WebFeaturePolicy* featurePolicy = securityContext()->getFeaturePolicy();
407 // The policy should always be initialized before checking it to ensure we
408 // properly inherit the parent policy.
409 DCHECK(featurePolicy);
410
411 // Otherwise, check policy.
412 return featurePolicy->IsFeatureEnabled(feature);
413 }
414
405 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 415 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
406 : m_treeNode(this), 416 : m_treeNode(this),
407 m_host(host), 417 m_host(host),
408 m_owner(owner), 418 m_owner(owner),
409 m_client(client), 419 m_client(client),
410 m_isLoading(false) { 420 m_isLoading(false) {
411 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); 421 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
412 422
413 ASSERT(page()); 423 ASSERT(page());
414 424
415 if (m_owner) 425 if (m_owner)
416 m_owner->setContentFrame(*this); 426 m_owner->setContentFrame(*this);
417 else 427 else
418 page()->setMainFrame(this); 428 page()->setMainFrame(this);
419 } 429 }
420 430
421 } // namespace blink 431 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Frame.h ('k') | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698