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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void History::back(ExecutionContext* context) | 101 void History::back(ExecutionContext* context) |
102 { | 102 { |
103 go(context, -1); | 103 go(context, -1); |
104 } | 104 } |
105 | 105 |
106 void History::forward(ExecutionContext* context) | 106 void History::forward(ExecutionContext* context) |
107 { | 107 { |
108 go(context, 1); | 108 go(context, 1); |
109 } | 109 } |
110 | 110 |
111 void History::go(ExecutionContext* context, int distance) | 111 void History::go(ExecutionContext* context, int delta) |
112 { | 112 { |
113 if (!m_frame || !m_frame->loader().client()) | 113 if (!m_frame || !m_frame->loader().client()) |
114 return; | 114 return; |
115 | 115 |
116 ASSERT(isMainThread()); | 116 ASSERT(isMainThread()); |
117 Document* activeDocument = toDocument(context); | 117 Document* activeDocument = toDocument(context); |
118 if (!activeDocument) | 118 if (!activeDocument) |
119 return; | 119 return; |
120 | 120 |
121 if (!activeDocument->frame() || !activeDocument->frame()->canNavigate(*m_fra
me)) | 121 if (!activeDocument->frame() || !activeDocument->frame()->canNavigate(*m_fra
me)) |
122 return; | 122 return; |
123 | 123 |
124 if (distance) | 124 if (delta) |
125 m_frame->loader().client()->navigateBackForward(distance); | 125 m_frame->loader().client()->navigateBackForward(delta); |
126 else | 126 else |
127 m_frame->reload(FrameLoadTypeReload, ClientRedirect); | 127 m_frame->reload(FrameLoadTypeReload, ClientRedirect); |
128 } | 128 } |
129 | 129 |
130 KURL History::urlForState(const String& urlString) | 130 KURL History::urlForState(const String& urlString) |
131 { | 131 { |
132 Document* document = m_frame->document(); | 132 Document* document = m_frame->document(); |
133 | 133 |
134 if (urlString.isNull()) | 134 if (urlString.isNull()) |
135 return document->url(); | 135 return document->url(); |
(...skipping 16 matching lines...) Expand all Loading... |
152 } | 152 } |
153 | 153 |
154 HistoryScrollRestorationType restorationType = ScrollRestorationAuto; | 154 HistoryScrollRestorationType restorationType = ScrollRestorationAuto; |
155 if (RuntimeEnabledFeatures::scrollRestorationEnabled() && options.scrollRest
oration() == "manual") | 155 if (RuntimeEnabledFeatures::scrollRestorationEnabled() && options.scrollRest
oration() == "manual") |
156 restorationType = ScrollRestorationManual; | 156 restorationType = ScrollRestorationManual; |
157 | 157 |
158 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type); | 158 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type); |
159 } | 159 } |
160 | 160 |
161 } // namespace blink | 161 } // namespace blink |
OLD | NEW |