| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 m_frame->navigationScheduler()->scheduleHistoryNavigation(distance); | 82 m_frame->navigationScheduler()->scheduleHistoryNavigation(distance); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void History::go(ScriptExecutionContext* context, int distance) | 85 void History::go(ScriptExecutionContext* context, int distance) |
| 86 { | 86 { |
| 87 if (!m_frame) | 87 if (!m_frame) |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 ASSERT(isMainThread()); | 90 ASSERT(isMainThread()); |
| 91 Frame* activeFrame = static_cast<Document*>(context)->frame(); | 91 Document* activeDocument = static_cast<Document*>(context); |
| 92 if (!activeFrame) | 92 if (!activeDocument) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 if (!activeFrame->loader()->shouldAllowNavigation(m_frame)) | 95 if (!activeDocument->canNavigate(m_frame)) |
| 96 return; | 96 return; |
| 97 | 97 |
| 98 m_frame->navigationScheduler()->scheduleHistoryNavigation(distance); | 98 m_frame->navigationScheduler()->scheduleHistoryNavigation(distance); |
| 99 } | 99 } |
| 100 | 100 |
| 101 KURL History::urlForState(const String& urlString) | 101 KURL History::urlForState(const String& urlString) |
| 102 { | 102 { |
| 103 KURL baseURL = m_frame->document()->baseURL(); | 103 KURL baseURL = m_frame->document()->baseURL(); |
| 104 if (urlString.isEmpty()) | 104 if (urlString.isEmpty()) |
| 105 return baseURL; | 105 return baseURL; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 126 if (!urlString.isEmpty()) | 126 if (!urlString.isEmpty()) |
| 127 m_frame->document()->updateURLForPushOrReplaceState(fullURL); | 127 m_frame->document()->updateURLForPushOrReplaceState(fullURL); |
| 128 | 128 |
| 129 if (stateObjectType == StateObjectPush) | 129 if (stateObjectType == StateObjectPush) |
| 130 m_frame->loader()->client()->dispatchDidPushStateWithinPage(); | 130 m_frame->loader()->client()->dispatchDidPushStateWithinPage(); |
| 131 else if (stateObjectType == StateObjectReplace) | 131 else if (stateObjectType == StateObjectReplace) |
| 132 m_frame->loader()->client()->dispatchDidReplaceStateWithinPage(); | 132 m_frame->loader()->client()->dispatchDidReplaceStateWithinPage(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace WebCore | 135 } // namespace WebCore |
| OLD | NEW |