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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 "set to propagate sandboxing to popups."; | 282 "set to propagate sandboxing to popups."; |
283 return false; | 283 return false; |
284 } | 284 } |
285 | 285 |
286 // Top navigation is forbidden unless opted-in. allow-top-navigation or | 286 // Top navigation is forbidden unless opted-in. allow-top-navigation or |
287 // allow-top-navigation-by-user-activation will also skips origin checks. | 287 // allow-top-navigation-by-user-activation will also skips origin checks. |
288 if (targetFrame == tree().top()) { | 288 if (targetFrame == tree().top()) { |
289 if (securityContext()->isSandboxed(SandboxTopNavigation) && | 289 if (securityContext()->isSandboxed(SandboxTopNavigation) && |
290 securityContext()->isSandboxed( | 290 securityContext()->isSandboxed( |
291 SandboxTopNavigationByUserActivation)) { | 291 SandboxTopNavigationByUserActivation)) { |
292 // TODO(binlu): To add "or 'allow-top-navigation-by-user-activation'" | |
293 // to the reason below, once the new flag is shipped. | |
294 reason = | 292 reason = |
295 "The frame attempting navigation of the top-level window is " | 293 "The frame attempting navigation of the top-level window is " |
296 "sandboxed, but the 'allow-top-navigation' flag is not set."; | 294 "sandboxed, but the flag of 'allow-top-navigation' or " |
| 295 "'allow-top-navigation-by-user-activation' is not set."; |
297 return false; | 296 return false; |
298 } | 297 } |
299 if (securityContext()->isSandboxed(SandboxTopNavigation) && | 298 if (securityContext()->isSandboxed(SandboxTopNavigation) && |
300 !securityContext()->isSandboxed( | 299 !securityContext()->isSandboxed( |
301 SandboxTopNavigationByUserActivation) && | 300 SandboxTopNavigationByUserActivation) && |
302 !UserGestureIndicator::processingUserGesture()) { | 301 !UserGestureIndicator::processingUserGesture()) { |
303 // With only 'allow-top-navigation-by-user-activation' (but not | 302 // With only 'allow-top-navigation-by-user-activation' (but not |
304 // 'allow-top-navigation'), top navigation requires a user gesture. | 303 // 'allow-top-navigation'), top navigation requires a user gesture. |
305 reason = | 304 reason = |
306 "The frame attempting navigation of the top-level window is " | 305 "The frame attempting navigation of the top-level window is " |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 413 |
415 ASSERT(page()); | 414 ASSERT(page()); |
416 | 415 |
417 if (m_owner) | 416 if (m_owner) |
418 m_owner->setContentFrame(*this); | 417 m_owner->setContentFrame(*this); |
419 else | 418 else |
420 page()->setMainFrame(this); | 419 page()->setMainFrame(this); |
421 } | 420 } |
422 | 421 |
423 } // namespace blink | 422 } // namespace blink |
OLD | NEW |