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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
916 | 916 |
917 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) | 917 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) |
918 : m_frame(&frame) { | 918 : m_frame(&frame) { |
919 m_frame->disableNavigation(); | 919 m_frame->disableNavigation(); |
920 } | 920 } |
921 | 921 |
922 FrameNavigationDisabler::~FrameNavigationDisabler() { | 922 FrameNavigationDisabler::~FrameNavigationDisabler() { |
923 m_frame->enableNavigation(); | 923 m_frame->enableNavigation(); |
924 } | 924 } |
925 | 925 |
926 bool LocalFrame::isNavigationAllowed() const { | |
927 for (const Frame* currentFrame = this; currentFrame; | |
928 currentFrame = currentFrame->tree().parent()) { | |
929 if (currentFrame->isLocalFrame() && | |
dcheng
2017/01/04 23:12:02
I'd rather keep this non-recursive: I don't like h
lfg
2017/01/09 19:04:12
Done.
| |
930 toLocalFrame(currentFrame)->m_navigationDisableCount > 0) { | |
931 return false; | |
932 } | |
933 } | |
934 | |
935 return true; | |
936 } | |
937 | |
926 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { | 938 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { |
927 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 939 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
928 m_frame->client()->frameBlameContext()->Enter(); | 940 m_frame->client()->frameBlameContext()->Enter(); |
929 } | 941 } |
930 | 942 |
931 ScopedFrameBlamer::~ScopedFrameBlamer() { | 943 ScopedFrameBlamer::~ScopedFrameBlamer() { |
932 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 944 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
933 m_frame->client()->frameBlameContext()->Leave(); | 945 m_frame->client()->frameBlameContext()->Leave(); |
934 } | 946 } |
935 | 947 |
936 } // namespace blink | 948 } // namespace blink |
OLD | NEW |