Chromium Code Reviews| Index: Source/core/frame/DOMWindow.h |
| diff --git a/Source/core/frame/DOMWindow.h b/Source/core/frame/DOMWindow.h |
| index d514d60461a3231c0efd5c2ae9e9d12599fb562a..1c3682c973e29c4987a99203d352fb898e4aa6f4 100644 |
| --- a/Source/core/frame/DOMWindow.h |
| +++ b/Source/core/frame/DOMWindow.h |
| @@ -6,25 +6,40 @@ |
| #define DOMWindow_h |
| #include "core/events/EventTarget.h" |
| +#include "core/frame/DOMWindowBase64.h" |
| #include "platform/heap/Handle.h" |
| +#include "platform/scroll/ScrollableArea.h" |
| + |
| +#include "wtf/Forward.h" |
| namespace blink { |
| class ApplicationCache; |
| class BarProp; |
| +class CSSRuleList; |
| +class CSSStyleDeclaration; |
| class Console; |
| +class DOMSelection; |
| class DOMWindowCSS; |
| class Document; |
| +class Element; |
| class Frame; |
| class History; |
| class Location; |
| +class MediaQueryList; |
| class Navigator; |
| class Performance; |
| +class RequestAnimationFrameCallback; |
| class Screen; |
| +class ScrollOptions; |
| +class SerializedScriptValue; |
| class Storage; |
| class StyleMedia; |
| -class DOMWindow : public RefCountedWillBeGarbageCollectedFinalized<DOMWindow>, public EventTargetWithInlineData { |
| +typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; |
| + |
| +class DOMWindow : public RefCountedWillBeGarbageCollectedFinalized<DOMWindow>, public EventTargetWithInlineData, public DOMWindowBase64 { |
| + DEFINE_WRAPPERTYPEINFO(); |
| REFCOUNTED_EVENT_TARGET(DOMWindow); |
| WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindow); |
| public: |
| @@ -34,6 +49,8 @@ public: |
| EventTargetWithInlineData::trace(visitor); |
| } |
| + virtual bool isLocalDOMWindow() const { return false; } |
| + |
| virtual Frame* frame() const = 0; |
| // DOM Level 0 |
| @@ -109,6 +126,71 @@ public: |
| virtual Performance* performance() const = 0; |
| virtual DOMWindowCSS* css() const = 0; |
| + |
| + virtual DOMSelection* getSelection() = 0; |
| + |
| + virtual void focus(ExecutionContext* = 0) = 0; |
| + virtual void blur() = 0; |
| + virtual void close(ExecutionContext* = 0) = 0; |
| + virtual void print() = 0; |
| + virtual void stop() = 0; |
| + |
| + virtual void alert(const String& message = String()) = 0; |
| + virtual bool confirm(const String& message) = 0; |
| + virtual String prompt(const String& message, const String& defaultValue) = 0; |
| + |
| + virtual bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const = 0; |
| + |
| + virtual void scrollBy(double x, double y, ScrollBehavior = ScrollBehaviorAuto) const = 0; |
| + virtual void scrollBy(double x, double y, const ScrollOptions&, ExceptionState&) const = 0; |
| + virtual void scrollTo(double x, double y, ScrollBehavior = ScrollBehaviorAuto) const = 0; |
| + virtual void scrollTo(double x, double y, const ScrollOptions&, ExceptionState&) const = 0; |
| + void scroll(double x, double y) const { scrollTo(x, y); } |
| + void scroll(double x, double y, const ScrollOptions& scrollOptions, ExceptionState& exceptionState) const { scrollTo(x, y, scrollOptions, exceptionState); } |
| + virtual void moveBy(float x, float y) const = 0; |
| + virtual void moveTo(float x, float y) const = 0; |
| + |
| + virtual void resizeBy(float x, float y) const = 0; |
| + virtual void resizeTo(float width, float height) const = 0; |
| + |
| + virtual PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&) = 0; |
| + |
| + // DOM Level 2 Style Interface |
| + virtual PassRefPtrWillBeRawPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const = 0; |
| + |
| + // WebKit extensions |
| + virtual PassRefPtrWillBeRawPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt) const = 0; |
| + |
| + // WebKit animation extensions |
| + virtual int requestAnimationFrame(RequestAnimationFrameCallback*) = 0; |
| + virtual int webkitRequestAnimationFrame(RequestAnimationFrameCallback*) = 0; |
| + virtual void cancelAnimationFrame(int id) = 0; |
| + |
| + void captureEvents() { } |
| + void releaseEvents() { } |
| + |
| + // FIXME: Should this be returning DOMWindows? |
| + virtual LocalDOMWindow* anonymousIndexedGetter(uint32_t) = 0; |
| + |
| + virtual void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, LocalDOMWindow* source, ExceptionState&) = 0; |
|
dcheng
2014/10/31 03:20:41
I can split this into a separate CL if it will mak
|
| + |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(search); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); |
| + |
| + DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimationStart); |
| + DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnimationIteration); |
| + DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEnd); |
| + DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransitionEnd); |
| + |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); |
|
dcheng
2014/10/31 03:20:41
I feel like we could do a little better here--Remo
|
| }; |
| } // namespace blink |