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 21 matching lines...) Expand all Loading... |
32 #include "core/frame/DOMWindowProperty.h" | 32 #include "core/frame/DOMWindowProperty.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class LocalFrame; | 38 class LocalFrame; |
39 class KURL; | 39 class KURL; |
40 class ExecutionContext; | 40 class ExecutionContext; |
41 class ExceptionState; | 41 class ExceptionState; |
42 class StateOptions; | |
43 | 42 |
44 class History final : public GarbageCollectedFinalized<History>, public ScriptWr
appable, public DOMWindowProperty { | 43 class History final : public GarbageCollectedFinalized<History>, public ScriptWr
appable, public DOMWindowProperty { |
45 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(History); | 45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(History); |
47 public: | 46 public: |
48 static History* create(LocalFrame* frame) | 47 static History* create(LocalFrame* frame) |
49 { | 48 { |
50 return new History(frame); | 49 return new History(frame); |
51 } | 50 } |
52 | 51 |
53 unsigned length() const; | 52 unsigned length() const; |
54 SerializedScriptValue* state(); | 53 SerializedScriptValue* state(); |
55 void options(StateOptions&); | |
56 | 54 |
57 void back(ExecutionContext*); | 55 void back(ExecutionContext*); |
58 void forward(ExecutionContext*); | 56 void forward(ExecutionContext*); |
59 void go(ExecutionContext*, int delta); | 57 void go(ExecutionContext*, int delta); |
60 | 58 |
61 void pushState(PassRefPtr<SerializedScriptValue> data, const String& title,
const String& url, const StateOptions& options, ExceptionState& exceptionState) | 59 void pushState(PassRefPtr<SerializedScriptValue> data, const String& title,
const String& url, ExceptionState& exceptionState) |
62 { | 60 { |
63 stateObjectAdded(data, title, url, options, FrameLoadTypeStandard, excep
tionState); | 61 stateObjectAdded(data, title, url, scrollRestorationInternal(), FrameLoa
dTypeStandard, exceptionState); |
64 } | 62 } |
65 | 63 |
66 void replaceState(PassRefPtr<SerializedScriptValue> data, const String& titl
e, const String& url, const StateOptions& options, ExceptionState& exceptionStat
e) | 64 void replaceState(PassRefPtr<SerializedScriptValue> data, const String& titl
e, const String& url, ExceptionState& exceptionState) |
67 { | 65 { |
68 stateObjectAdded(data, title, url, options, FrameLoadTypeReplaceCurrentI
tem, exceptionState); | 66 stateObjectAdded(data, title, url, scrollRestorationInternal(), FrameLoa
dTypeReplaceCurrentItem, exceptionState); |
69 } | 67 } |
70 | 68 |
| 69 void setScrollRestoration(const String& value); |
| 70 String scrollRestoration(); |
| 71 |
71 bool stateChanged() const; | 72 bool stateChanged() const; |
72 bool isSameAsCurrentState(SerializedScriptValue*) const; | 73 bool isSameAsCurrentState(SerializedScriptValue*) const; |
73 | 74 |
74 void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title
, const String& url, const StateOptions&, FrameLoadType, ExceptionState&); | |
75 | 75 |
76 DECLARE_VIRTUAL_TRACE(); | 76 DECLARE_VIRTUAL_TRACE(); |
77 | 77 |
78 private: | 78 private: |
79 explicit History(LocalFrame*); | 79 explicit History(LocalFrame*); |
80 | 80 |
81 KURL urlForState(const String& url); | 81 KURL urlForState(const String& url); |
82 | 82 |
| 83 void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title
, const String& url, HistoryScrollRestorationType, FrameLoadType, ExceptionState
&); |
83 SerializedScriptValue* stateInternal() const; | 84 SerializedScriptValue* stateInternal() const; |
| 85 HistoryScrollRestorationType scrollRestorationInternal() const; |
84 | 86 |
85 RefPtr<SerializedScriptValue> m_lastStateObjectRequested; | 87 RefPtr<SerializedScriptValue> m_lastStateObjectRequested; |
86 }; | 88 }; |
87 | 89 |
88 } // namespace blink | 90 } // namespace blink |
89 | 91 |
90 #endif // History_h | 92 #endif // History_h |
OLD | NEW |