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

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

Issue 2696703010: Rename the flag of 'allow-top-navigation-with-user-activation' to 'allow-top-navigation-by-user-act… (Closed)
Patch Set: Add the *-with-two-flags-expected.txt that I forgot previously. Created 3 years, 10 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 (securityContext()->isSandboxed(SandboxPopups) || 278 (securityContext()->isSandboxed(SandboxPopups) ||
279 targetFrame.client()->opener() != this)) { 279 targetFrame.client()->opener() != this)) {
280 reason = 280 reason =
281 "The frame attempting navigation is sandboxed and is trying " 281 "The frame attempting navigation is sandboxed and is trying "
282 "to navigate a popup, but is not the popup's opener and is not " 282 "to navigate a popup, but is not the popup's opener and is not "
283 "set to propagate sandboxing to popups."; 283 "set to propagate sandboxing to popups.";
284 return false; 284 return false;
285 } 285 }
286 286
287 // Top navigation is forbidden unless opted-in. allow-top-navigation or 287 // Top navigation is forbidden unless opted-in. allow-top-navigation or
288 // allow-top-navigation-with-user-activation will also skips origin checks. 288 // allow-top-navigation-by-user-activation will also skips origin checks.
289 if (targetFrame == tree().top()) { 289 if (targetFrame == tree().top()) {
290 if (securityContext()->isSandboxed(SandboxTopNavigation) && 290 if (securityContext()->isSandboxed(SandboxTopNavigation) &&
291 securityContext()->isSandboxed( 291 securityContext()->isSandboxed(
292 SandboxTopNavigationWithUserActivation)) { 292 SandboxTopNavigationByUserActivation)) {
293 // TODO(binlu): To add "or 'allow-top-navigation-with-user-activation'" 293 // TODO(binlu): To add "or 'allow-top-navigation-by-user-activation'"
294 // to the reason below, once the new flag is shipped. 294 // to the reason below, once the new flag is shipped.
295 reason = 295 reason =
296 "The frame attempting navigation of the top-level window is " 296 "The frame attempting navigation of the top-level window is "
297 "sandboxed, but the 'allow-top-navigation' flag is not set."; 297 "sandboxed, but the 'allow-top-navigation' flag is not set.";
298 return false; 298 return false;
299 } 299 }
300 if (securityContext()->isSandboxed(SandboxTopNavigation) && 300 if (securityContext()->isSandboxed(SandboxTopNavigation) &&
301 !securityContext()->isSandboxed( 301 !securityContext()->isSandboxed(
302 SandboxTopNavigationWithUserActivation) && 302 SandboxTopNavigationByUserActivation) &&
303 !UserGestureIndicator::processingUserGesture()) { 303 !UserGestureIndicator::processingUserGesture()) {
304 // With only 'allow-top-navigation-with-user-activation' (but not 304 // With only 'allow-top-navigation-by-user-activation' (but not
305 // 'allow-top-navigation'), top navigation requires a user gesture. 305 // 'allow-top-navigation'), top navigation requires a user gesture.
306 reason = 306 reason =
307 "The frame attempting navigation of the top-level window is " 307 "The frame attempting navigation of the top-level window is "
308 "sandboxed with the 'allow-top-navigation-with-user-activation' " 308 "sandboxed with the 'allow-top-navigation-by-user-activation' "
309 "flag, but has no user activation (aka gesture). See " 309 "flag, but has no user activation (aka gesture). See "
310 "https://www.chromestatus.com/feature/5629582019395584."; 310 "https://www.chromestatus.com/feature/5629582019395584.";
311 return false; 311 return false;
312 } 312 }
313 return true; 313 return true;
314 } 314 }
315 } 315 }
316 316
317 ASSERT(securityContext()->getSecurityOrigin()); 317 ASSERT(securityContext()->getSecurityOrigin());
318 SecurityOrigin& origin = *securityContext()->getSecurityOrigin(); 318 SecurityOrigin& origin = *securityContext()->getSecurityOrigin();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 ASSERT(page()); 416 ASSERT(page());
417 417
418 if (m_owner) 418 if (m_owner)
419 m_owner->setContentFrame(*this); 419 m_owner->setContentFrame(*this);
420 else 420 else
421 page()->setMainFrame(this); 421 page()->setMainFrame(this);
422 } 422 }
423 423
424 } // namespace blink 424 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SandboxFlags.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698