| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 5 * Copyright (C) 2009 Adam Barth. All rights reserved. | 5 * Copyright (C) 2009 Adam Barth. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void fire(LocalFrame* frame) override | 151 void fire(LocalFrame* frame) override |
| 152 { | 152 { |
| 153 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); | 153 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat
or(); |
| 154 FrameLoadRequest request(originDocument(), url(), "_self"); | 154 FrameLoadRequest request(originDocument(), url(), "_self"); |
| 155 request.setReplacesCurrentItem(replacesCurrentItem()); | 155 request.setReplacesCurrentItem(replacesCurrentItem()); |
| 156 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) | 156 if (equalIgnoringFragmentIdentifier(frame->document()->url(), request.re
sourceRequest().url())) |
| 157 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); | 157 request.resourceRequest().setCachePolicy(ReloadIgnoringCacheData); |
| 158 request.setClientRedirect(ClientRedirect); | 158 request.setClientRedirect(ClientRedirect); |
| 159 frame->loader().load(request); | 159 frame->loader().load(request); |
| 160 } | 160 } |
| 161 |
| 161 private: | 162 private: |
| 162 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool replacesCurrentItem) | 163 ScheduledRedirect(double delay, Document* originDocument, const String& url,
bool replacesCurrentItem) |
| 163 : ScheduledURLNavigation(delay, originDocument, url, replacesCurrentItem
, false) | 164 : ScheduledURLNavigation(delay, originDocument, url, replacesCurrentItem
, false) |
| 164 { | 165 { |
| 165 clearUserGesture(); | 166 clearUserGesture(); |
| 166 } | 167 } |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 class ScheduledLocationChange final : public ScheduledURLNavigation { | 170 class ScheduledLocationChange final : public ScheduledURLNavigation { |
| 170 public: | 171 public: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 273 |
| 273 NavigationScheduler::~NavigationScheduler() | 274 NavigationScheduler::~NavigationScheduler() |
| 274 { | 275 { |
| 275 } | 276 } |
| 276 | 277 |
| 277 bool NavigationScheduler::locationChangePending() | 278 bool NavigationScheduler::locationChangePending() |
| 278 { | 279 { |
| 279 return m_redirect && m_redirect->isLocationChange(); | 280 return m_redirect && m_redirect->isLocationChange(); |
| 280 } | 281 } |
| 281 | 282 |
| 283 bool NavigationScheduler::isNavigationScheduled() const |
| 284 { |
| 285 return m_redirect; |
| 286 } |
| 287 |
| 282 inline bool NavigationScheduler::shouldScheduleReload() const | 288 inline bool NavigationScheduler::shouldScheduleReload() const |
| 283 { | 289 { |
| 284 return m_frame->page() && isFrameNavigationAllowed() && NavigationDisablerFo
rBeforeUnload::isNavigationAllowed(); | 290 return m_frame->page() && isFrameNavigationAllowed() && NavigationDisablerFo
rBeforeUnload::isNavigationAllowed(); |
| 285 } | 291 } |
| 286 | 292 |
| 287 inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) con
st | 293 inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) con
st |
| 288 { | 294 { |
| 289 return m_frame->page() && isFrameNavigationAllowed() && (protocolIsJavaScrip
t(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed()); | 295 return m_frame->page() && isFrameNavigationAllowed() && (protocolIsJavaScrip
t(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed()); |
| 290 } | 296 } |
| 291 | 297 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 m_redirect.clear(); | 430 m_redirect.clear(); |
| 425 } | 431 } |
| 426 | 432 |
| 427 DEFINE_TRACE(NavigationScheduler) | 433 DEFINE_TRACE(NavigationScheduler) |
| 428 { | 434 { |
| 429 visitor->trace(m_frame); | 435 visitor->trace(m_frame); |
| 430 visitor->trace(m_redirect); | 436 visitor->trace(m_redirect); |
| 431 } | 437 } |
| 432 | 438 |
| 433 } // namespace blink | 439 } // namespace blink |
| OLD | NEW |