OLD | NEW |
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 return false; | 168 return false; |
169 } | 169 } |
170 | 170 |
171 bool Frame::canNavigate(const Frame& targetFrame) { | 171 bool Frame::canNavigate(const Frame& targetFrame) { |
172 String errorReason; | 172 String errorReason; |
173 const bool isAllowedNavigation = | 173 const bool isAllowedNavigation = |
174 canNavigateWithoutFramebusting(targetFrame, errorReason); | 174 canNavigateWithoutFramebusting(targetFrame, errorReason); |
175 const bool sandboxed = securityContext()->getSandboxFlags() != SandboxNone; | 175 const bool sandboxed = securityContext()->getSandboxFlags() != SandboxNone; |
176 const bool hasUserGesture = | 176 const bool hasUserGesture = |
177 isLocalFrame() ? toLocalFrame(this)->document()->hasReceivedUserGesture() | 177 isLocalFrame() ? toLocalFrame(this)->hasReceivedUserGesture() : false; |
178 : false; | |
179 | 178 |
180 // Top navigation in sandbox with or w/o 'allow-top-navigation'. | 179 // Top navigation in sandbox with or w/o 'allow-top-navigation'. |
181 if (targetFrame != this && sandboxed && targetFrame == tree().top()) { | 180 if (targetFrame != this && sandboxed && targetFrame == tree().top()) { |
182 UseCounter::count(&targetFrame, UseCounter::TopNavInSandbox); | 181 UseCounter::count(&targetFrame, UseCounter::TopNavInSandbox); |
183 if (!hasUserGesture) { | 182 if (!hasUserGesture) { |
184 UseCounter::count(&targetFrame, | 183 UseCounter::count(&targetFrame, |
185 UseCounter::TopNavInSandboxWithoutGesture); | 184 UseCounter::TopNavInSandboxWithoutGesture); |
186 } | 185 } |
187 } | 186 } |
188 | 187 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 392 |
394 void Frame::didChangeVisibilityState() { | 393 void Frame::didChangeVisibilityState() { |
395 HeapVector<Member<Frame>> childFrames; | 394 HeapVector<Member<Frame>> childFrames; |
396 for (Frame* child = tree().firstChild(); child; | 395 for (Frame* child = tree().firstChild(); child; |
397 child = child->tree().nextSibling()) | 396 child = child->tree().nextSibling()) |
398 childFrames.push_back(child); | 397 childFrames.push_back(child); |
399 for (size_t i = 0; i < childFrames.size(); ++i) | 398 for (size_t i = 0; i < childFrames.size(); ++i) |
400 childFrames[i]->didChangeVisibilityState(); | 399 childFrames[i]->didChangeVisibilityState(); |
401 } | 400 } |
402 | 401 |
| 402 void Frame::setDocumentHasReceivedUserGesture() { |
| 403 m_hasReceivedUserGesture = true; |
| 404 if (Frame* parent = tree().parent()) |
| 405 parent->setDocumentHasReceivedUserGesture(); |
| 406 } |
| 407 |
403 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) | 408 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
404 : m_treeNode(this), | 409 : m_treeNode(this), |
405 m_host(host), | 410 m_host(host), |
406 m_owner(owner), | 411 m_owner(owner), |
407 m_client(client), | 412 m_client(client), |
408 m_isLoading(false) { | 413 m_isLoading(false) { |
409 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); | 414 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); |
410 | 415 |
411 ASSERT(page()); | 416 ASSERT(page()); |
412 | 417 |
413 if (m_owner) | 418 if (m_owner) |
414 m_owner->setContentFrame(*this); | 419 m_owner->setContentFrame(*this); |
415 else | 420 else |
416 page()->setMainFrame(this); | 421 page()->setMainFrame(this); |
417 } | 422 } |
418 | 423 |
419 } // namespace blink | 424 } // namespace blink |
OLD | NEW |