Chromium Code Reviews| 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 "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 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* visitor) override |
| 48 { | 50 { |
| 49 EventTargetWithInlineData::trace(visitor); | 51 EventTargetWithInlineData::trace(visitor); |
|
haraken
2015/02/03 00:56:09
Nit: Make the trace call to a super class a tail c
Nate Chapin
2015/02/03 19:17:21
Done.
| |
| 52 visitor->trace(m_location); | |
| 50 } | 53 } |
| 51 | 54 |
| 52 virtual bool isLocalDOMWindow() const { return false; } | 55 virtual bool isLocalDOMWindow() const { return false; } |
| 53 virtual bool isRemoteDOMWindow() const { return false; } | 56 virtual bool isRemoteDOMWindow() const { return false; } |
| 54 | 57 |
| 55 virtual Frame* frame() const = 0; | 58 virtual Frame* frame() const = 0; |
| 56 | 59 |
| 57 // DOM Level 0 | 60 // DOM Level 0 |
| 58 virtual Screen* screen() const = 0; | 61 virtual Screen* screen() const = 0; |
| 59 virtual History* history() const = 0; | 62 virtual History* history() const = 0; |
| 60 virtual BarProp* locationbar() const = 0; | 63 virtual BarProp* locationbar() const = 0; |
| 61 virtual BarProp* menubar() const = 0; | 64 virtual BarProp* menubar() const = 0; |
| 62 virtual BarProp* personalbar() const = 0; | 65 virtual BarProp* personalbar() const = 0; |
| 63 virtual BarProp* scrollbars() const = 0; | 66 virtual BarProp* scrollbars() const = 0; |
| 64 virtual BarProp* statusbar() const = 0; | 67 virtual BarProp* statusbar() const = 0; |
| 65 virtual BarProp* toolbar() const = 0; | 68 virtual BarProp* toolbar() const = 0; |
| 66 virtual Navigator* navigator() const = 0; | 69 virtual Navigator* navigator() const = 0; |
| 67 Navigator* clientInformation() const { return navigator(); } | 70 Navigator* clientInformation() const { return navigator(); } |
| 68 // FIXME: Temporary, until window.location is implemented for remote frames. | 71 Location* location() const; |
| 69 virtual Location* location() const = 0; | |
| 70 | 72 |
| 71 virtual bool offscreenBuffering() const = 0; | 73 virtual bool offscreenBuffering() const = 0; |
| 72 | 74 |
| 73 virtual int outerHeight() const = 0; | 75 virtual int outerHeight() const = 0; |
| 74 virtual int outerWidth() const = 0; | 76 virtual int outerWidth() const = 0; |
| 75 virtual int innerHeight() const = 0; | 77 virtual int innerHeight() const = 0; |
| 76 virtual int innerWidth() const = 0; | 78 virtual int innerWidth() const = 0; |
| 77 virtual int screenX() const = 0; | 79 virtual int screenX() const = 0; |
| 78 virtual int screenY() const = 0; | 80 virtual int screenY() const = 0; |
| 79 int screenLeft() const { return screenX(); } | 81 int screenLeft() const { return screenX(); } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 virtual String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow) = 0; | 189 virtual String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow) = 0; |
| 188 virtual bool isInsecureScriptAccess(DOMWindow& callingWindow, const String& urlString); | 190 virtual bool isInsecureScriptAccess(DOMWindow& callingWindow, const String& urlString); |
| 189 | 191 |
| 190 // 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., |
| 191 // 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 |
| 192 // 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 |
| 193 // by the document that is currently active in m_frame. | 195 // by the document that is currently active in m_frame. |
| 194 // See https://bugs.webkit.org/show_bug.cgi?id=62054 | 196 // See https://bugs.webkit.org/show_bug.cgi?id=62054 |
| 195 bool isCurrentlyDisplayedInFrame() const; | 197 bool isCurrentlyDisplayedInFrame() const; |
| 196 | 198 |
| 199 virtual void reset(); | |
| 200 | |
| 197 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); | 201 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); |
| 198 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); | 202 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); |
| 199 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); | 203 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); |
| 200 DEFINE_ATTRIBUTE_EVENT_LISTENER(search); | 204 DEFINE_ATTRIBUTE_EVENT_LISTENER(search); |
| 201 DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); | 205 DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); |
| 202 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); | 206 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); |
| 203 | 207 |
| 204 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimation Start); | 208 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimation Start); |
| 205 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnima tionIteration); | 209 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnima tionIteration); |
| 206 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEn d); | 210 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEn d); |
| 207 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransition End); | 211 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransition End); |
| 208 | 212 |
| 209 DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); | 213 DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); |
| 210 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); | 214 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); |
| 211 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); | 215 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); |
| 212 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); | 216 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); |
| 213 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); | 217 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); |
| 218 | |
| 219 private: | |
| 220 mutable RefPtrWillBeMember<Location> m_location; | |
| 214 }; | 221 }; |
| 215 | 222 |
| 216 } // namespace blink | 223 } // namespace blink |
| 217 | 224 |
| 218 #endif // DOMWindow_h | 225 #endif // DOMWindow_h |
| OLD | NEW |