Chromium Code Reviews| 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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 915 | 915 |
| 916 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) | 916 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) |
| 917 : m_frame(&frame) { | 917 : m_frame(&frame) { |
| 918 m_frame->disableNavigation(); | 918 m_frame->disableNavigation(); |
| 919 } | 919 } |
| 920 | 920 |
| 921 FrameNavigationDisabler::~FrameNavigationDisabler() { | 921 FrameNavigationDisabler::~FrameNavigationDisabler() { |
| 922 m_frame->enableNavigation(); | 922 m_frame->enableNavigation(); |
| 923 } | 923 } |
| 924 | 924 |
| 925 bool LocalFrame::isNavigationAllowed() const { | |
| 926 for (const Frame* cur = this; cur; cur = cur->tree().parent()) { | |
|
dcheng
2016/12/08 23:16:53
Nit: no abbreviations in naming
lfg
2016/12/12 23:12:40
Done.
| |
| 927 if (cur->isLocalFrame() && toLocalFrame(cur)->m_navigationDisableCount > 0) | |
| 928 return false; | |
| 929 } | |
| 930 | |
| 931 return true; | |
| 932 } | |
| 933 | |
| 925 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { | 934 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { |
| 926 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 935 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 927 m_frame->client()->frameBlameContext()->Enter(); | 936 m_frame->client()->frameBlameContext()->Enter(); |
| 928 } | 937 } |
| 929 | 938 |
| 930 ScopedFrameBlamer::~ScopedFrameBlamer() { | 939 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 931 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 940 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 932 m_frame->client()->frameBlameContext()->Leave(); | 941 m_frame->client()->frameBlameContext()->Leave(); |
| 933 } | 942 } |
| 934 | 943 |
| 935 } // namespace blink | 944 } // namespace blink |
| OLD | NEW |