OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DOMWindow_h | 5 #ifndef DOMWindow_h |
6 #define DOMWindow_h | 6 #define DOMWindow_h |
7 | 7 |
8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
9 #include "core/frame/DOMWindowBase64.h" | 9 #include "core/frame/DOMWindowBase64.h" |
| 10 #include "core/frame/Location.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 #include "platform/scroll/ScrollableArea.h" | 12 #include "platform/scroll/ScrollableArea.h" |
12 | 13 |
13 #include "wtf/Forward.h" | 14 #include "wtf/Forward.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class ApplicationCache; | 18 class ApplicationCache; |
18 class BarProp; | 19 class BarProp; |
19 class CSSRuleList; | 20 class CSSRuleList; |
20 class CSSStyleDeclaration; | 21 class CSSStyleDeclaration; |
21 class Console; | 22 class Console; |
22 class DOMSelection; | 23 class DOMSelection; |
23 class DOMWindowCSS; | 24 class DOMWindowCSS; |
24 class Document; | 25 class Document; |
25 class Element; | 26 class Element; |
26 class Frame; | 27 class Frame; |
27 class History; | 28 class History; |
28 class LocalDOMWindow; | 29 class LocalDOMWindow; |
29 class Location; | |
30 class MediaQueryList; | 30 class MediaQueryList; |
31 class Navigator; | 31 class Navigator; |
32 class Performance; | 32 class Performance; |
33 class RequestAnimationFrameCallback; | 33 class RequestAnimationFrameCallback; |
34 class Screen; | 34 class Screen; |
35 class ScrollToOptions; | 35 class ScrollToOptions; |
36 class SerializedScriptValue; | 36 class SerializedScriptValue; |
37 class Storage; | 37 class Storage; |
38 class StyleMedia; | 38 class StyleMedia; |
39 | 39 |
40 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; | 40 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; |
41 | 41 |
42 class DOMWindow : public EventTargetWithInlineData, public RefCountedWillBeNoBas
e<DOMWindow>, public DOMWindowBase64 { | 42 class DOMWindow : public EventTargetWithInlineData, public RefCountedWillBeNoBas
e<DOMWindow>, public DOMWindowBase64 { |
43 DEFINE_WRAPPERTYPEINFO(); | 43 DEFINE_WRAPPERTYPEINFO(); |
44 REFCOUNTED_EVENT_TARGET(DOMWindow); | 44 REFCOUNTED_EVENT_TARGET(DOMWindow); |
45 public: | 45 public: |
| 46 virtual ~DOMWindow(); |
| 47 |
46 // RefCountedWillBeGarbageCollectedFinalized overrides: | 48 // RefCountedWillBeGarbageCollectedFinalized overrides: |
47 void trace(Visitor* visitor) override | 49 void trace(Visitor*) override; |
48 { | |
49 EventTargetWithInlineData::trace(visitor); | |
50 } | |
51 | 50 |
52 virtual bool isLocalDOMWindow() const { return false; } | 51 virtual bool isLocalDOMWindow() const { return false; } |
53 virtual bool isRemoteDOMWindow() const { return false; } | 52 virtual bool isRemoteDOMWindow() const { return false; } |
54 | 53 |
55 virtual Frame* frame() const = 0; | 54 virtual Frame* frame() const = 0; |
56 | 55 |
57 // DOM Level 0 | 56 // DOM Level 0 |
58 virtual Screen* screen() const = 0; | 57 virtual Screen* screen() const = 0; |
59 virtual History* history() const = 0; | 58 virtual History* history() const = 0; |
60 virtual BarProp* locationbar() const = 0; | 59 virtual BarProp* locationbar() const = 0; |
61 virtual BarProp* menubar() const = 0; | 60 virtual BarProp* menubar() const = 0; |
62 virtual BarProp* personalbar() const = 0; | 61 virtual BarProp* personalbar() const = 0; |
63 virtual BarProp* scrollbars() const = 0; | 62 virtual BarProp* scrollbars() const = 0; |
64 virtual BarProp* statusbar() const = 0; | 63 virtual BarProp* statusbar() const = 0; |
65 virtual BarProp* toolbar() const = 0; | 64 virtual BarProp* toolbar() const = 0; |
66 virtual Navigator* navigator() const = 0; | 65 virtual Navigator* navigator() const = 0; |
67 Navigator* clientInformation() const { return navigator(); } | 66 Navigator* clientInformation() const { return navigator(); } |
68 // FIXME: Temporary, until window.location is implemented for remote frames. | 67 Location* location() const; |
69 virtual Location* location() const = 0; | |
70 | 68 |
71 virtual bool offscreenBuffering() const = 0; | 69 virtual bool offscreenBuffering() const = 0; |
72 | 70 |
73 virtual int outerHeight() const = 0; | 71 virtual int outerHeight() const = 0; |
74 virtual int outerWidth() const = 0; | 72 virtual int outerWidth() const = 0; |
75 virtual int innerHeight() const = 0; | 73 virtual int innerHeight() const = 0; |
76 virtual int innerWidth() const = 0; | 74 virtual int innerWidth() const = 0; |
77 virtual int screenX() const = 0; | 75 virtual int screenX() const = 0; |
78 virtual int screenY() const = 0; | 76 virtual int screenY() const = 0; |
79 int screenLeft() const { return screenX(); } | 77 int screenLeft() const { return screenX(); } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 virtual String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
= 0; | 189 virtual String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
= 0; |
192 virtual bool isInsecureScriptAccess(DOMWindow& callingWindow, const String&
urlString); | 190 virtual bool isInsecureScriptAccess(DOMWindow& callingWindow, const String&
urlString); |
193 | 191 |
194 // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e., | 192 // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e., |
195 // when its document is no longer the document that is displayed in its | 193 // when its document is no longer the document that is displayed in its |
196 // frame), we would like to zero out m_frame to avoid being confused | 194 // frame), we would like to zero out m_frame to avoid being confused |
197 // by the document that is currently active in m_frame. | 195 // by the document that is currently active in m_frame. |
198 // See https://bugs.webkit.org/show_bug.cgi?id=62054 | 196 // See https://bugs.webkit.org/show_bug.cgi?id=62054 |
199 bool isCurrentlyDisplayedInFrame() const; | 197 bool isCurrentlyDisplayedInFrame() const; |
200 | 198 |
| 199 void resetLocation(); |
| 200 |
201 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); | 201 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); |
202 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); | 202 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); |
203 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); | 203 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); |
204 DEFINE_ATTRIBUTE_EVENT_LISTENER(search); | 204 DEFINE_ATTRIBUTE_EVENT_LISTENER(search); |
205 DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); | 205 DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); |
206 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); | 206 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); |
207 | 207 |
208 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimation
Start); | 208 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimation
Start); |
209 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnima
tionIteration); | 209 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnima
tionIteration); |
210 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEn
d); | 210 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEn
d); |
211 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransition
End); | 211 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransition
End); |
212 | 212 |
213 DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); | 213 DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); |
214 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); | 214 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); |
215 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); | 215 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); |
216 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); | 216 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); |
217 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); | 217 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); |
| 218 |
| 219 private: |
| 220 mutable RefPtrWillBeMember<Location> m_location; |
218 }; | 221 }; |
219 | 222 |
220 } // namespace blink | 223 } // namespace blink |
221 | 224 |
222 #endif // DOMWindow_h | 225 #endif // DOMWindow_h |
OLD | NEW |