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

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

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Created 4 years, 2 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 if (hasUserGesture || isAllowedNavigation) 187 if (hasUserGesture || isAllowedNavigation)
188 return true; 188 return true;
189 errorReason = 189 errorReason =
190 "The frame attempting navigation is targeting its top-level window, " 190 "The frame attempting navigation is targeting its top-level window, "
191 "but is neither same-origin with its target nor is it processing a " 191 "but is neither same-origin with its target nor is it processing a "
192 "user gesture. See " 192 "user gesture. See "
193 "https://www.chromestatus.com/features/5851021045661696."; 193 "https://www.chromestatus.com/features/5851021045661696.";
194 printNavigationErrorMessage(targetFrame, errorReason.latin1().data()); 194 printNavigationErrorMessage(targetFrame, errorReason.latin1().data());
195 if (isLocalFrame()) 195 if (isLocalFrame())
196 toLocalFrame(this)->navigationScheduler().schedulePageBlock( 196 toLocalFrame(this)->navigationScheduler().schedulePageBlock(
197 toLocalFrame(this)->document()); 197 toLocalFrame(this)->document(), -27 /* net::ERR_BLOCKED_BY_CLIENT */);
198 return false; 198 return false;
199 } 199 }
200 if (!isAllowedNavigation && !errorReason.isNull()) 200 if (!isAllowedNavigation && !errorReason.isNull())
201 printNavigationErrorMessage(targetFrame, errorReason.latin1().data()); 201 printNavigationErrorMessage(targetFrame, errorReason.latin1().data());
202 return isAllowedNavigation; 202 return isAllowedNavigation;
203 } 203 }
204 204
205 bool Frame::canNavigateWithoutFramebusting(const Frame& targetFrame, 205 bool Frame::canNavigateWithoutFramebusting(const Frame& targetFrame,
206 String& reason) { 206 String& reason) {
207 if (securityContext()->isSandboxed(SandboxNavigation)) { 207 if (securityContext()->isSandboxed(SandboxNavigation)) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 ASSERT(page()); 331 ASSERT(page());
332 332
333 if (m_owner) 333 if (m_owner)
334 m_owner->setContentFrame(*this); 334 m_owner->setContentFrame(*this);
335 else 335 else
336 page()->setMainFrame(this); 336 page()->setMainFrame(this);
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698