Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: Source/core/frame/DOMWindow.h

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: whee Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
11 #include "platform/scroll/ScrollableArea.h"
12
13 #include "wtf/Forward.h"
10 14
11 namespace blink { 15 namespace blink {
12 16
13 class ApplicationCache; 17 class ApplicationCache;
14 class BarProp; 18 class BarProp;
19 class CSSRuleList;
20 class CSSStyleDeclaration;
15 class Console; 21 class Console;
22 class DOMSelection;
16 class DOMWindowCSS; 23 class DOMWindowCSS;
17 class Document; 24 class Document;
25 class Element;
18 class Frame; 26 class Frame;
19 class History; 27 class History;
20 class Location; 28 class Location;
29 class MediaQueryList;
21 class Navigator; 30 class Navigator;
22 class Performance; 31 class Performance;
32 class RequestAnimationFrameCallback;
23 class Screen; 33 class Screen;
34 class ScrollOptions;
35 class SerializedScriptValue;
24 class Storage; 36 class Storage;
25 class StyleMedia; 37 class StyleMedia;
26 38
27 class DOMWindow : public RefCountedWillBeGarbageCollectedFinalized<DOMWindow>, p ublic EventTargetWithInlineData { 39 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray;
40
41 class DOMWindow : public RefCountedWillBeGarbageCollectedFinalized<DOMWindow>, p ublic EventTargetWithInlineData, public DOMWindowBase64 {
42 DEFINE_WRAPPERTYPEINFO();
28 REFCOUNTED_EVENT_TARGET(DOMWindow); 43 REFCOUNTED_EVENT_TARGET(DOMWindow);
29 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindow); 44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindow);
30 public: 45 public:
31 // RefCountedWillBeGarbageCollectedFinalized overrides: 46 // RefCountedWillBeGarbageCollectedFinalized overrides:
32 void trace(Visitor* visitor) override 47 void trace(Visitor* visitor) override
33 { 48 {
34 EventTargetWithInlineData::trace(visitor); 49 EventTargetWithInlineData::trace(visitor);
35 } 50 }
36 51
52 virtual bool isLocalDOMWindow() const { return false; }
53
37 virtual Frame* frame() const = 0; 54 virtual Frame* frame() const = 0;
38 55
39 // DOM Level 0 56 // DOM Level 0
40 virtual Screen* screen() const = 0; 57 virtual Screen* screen() const = 0;
41 virtual History* history() const = 0; 58 virtual History* history() const = 0;
42 virtual BarProp* locationbar() const = 0; 59 virtual BarProp* locationbar() const = 0;
43 virtual BarProp* menubar() const = 0; 60 virtual BarProp* menubar() const = 0;
44 virtual BarProp* personalbar() const = 0; 61 virtual BarProp* personalbar() const = 0;
45 virtual BarProp* scrollbars() const = 0; 62 virtual BarProp* scrollbars() const = 0;
46 virtual BarProp* statusbar() const = 0; 63 virtual BarProp* statusbar() const = 0;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // This is the interface orientation in degrees. Some examples are: 119 // This is the interface orientation in degrees. Some examples are:
103 // 0 is straight up; -90 is when the device is rotated 90 clockwise; 120 // 0 is straight up; -90 is when the device is rotated 90 clockwise;
104 // 90 is when rotated counter clockwise. 121 // 90 is when rotated counter clockwise.
105 virtual int orientation() const = 0; 122 virtual int orientation() const = 0;
106 123
107 virtual Console* console() const = 0; 124 virtual Console* console() const = 0;
108 125
109 virtual Performance* performance() const = 0; 126 virtual Performance* performance() const = 0;
110 127
111 virtual DOMWindowCSS* css() const = 0; 128 virtual DOMWindowCSS* css() const = 0;
129
130 virtual DOMSelection* getSelection() = 0;
131
132 virtual void focus(ExecutionContext* = 0) = 0;
133 virtual void blur() = 0;
134 virtual void close(ExecutionContext* = 0) = 0;
135 virtual void print() = 0;
136 virtual void stop() = 0;
137
138 virtual void alert(const String& message = String()) = 0;
139 virtual bool confirm(const String& message) = 0;
140 virtual String prompt(const String& message, const String& defaultValue) = 0 ;
141
142 virtual bool find(const String&, bool caseSensitive, bool backwards, bool wr ap, bool wholeWord, bool searchInFrames, bool showDialog) const = 0;
143
144 virtual void scrollBy(double x, double y, ScrollBehavior = ScrollBehaviorAut o) const = 0;
145 virtual void scrollBy(double x, double y, const ScrollOptions&, ExceptionSta te&) const = 0;
146 virtual void scrollTo(double x, double y, ScrollBehavior = ScrollBehaviorAut o) const = 0;
147 virtual void scrollTo(double x, double y, const ScrollOptions&, ExceptionSta te&) const = 0;
148 void scroll(double x, double y) const { scrollTo(x, y); }
149 void scroll(double x, double y, const ScrollOptions& scrollOptions, Exceptio nState& exceptionState) const { scrollTo(x, y, scrollOptions, exceptionState); }
150 virtual void moveBy(float x, float y) const = 0;
151 virtual void moveTo(float x, float y) const = 0;
152
153 virtual void resizeBy(float x, float y) const = 0;
154 virtual void resizeTo(float width, float height) const = 0;
155
156 virtual PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&) = 0 ;
157
158 // DOM Level 2 Style Interface
159 virtual PassRefPtrWillBeRawPtr<CSSStyleDeclaration> getComputedStyle(Element *, const String& pseudoElt) const = 0;
160
161 // WebKit extensions
162 virtual PassRefPtrWillBeRawPtr<CSSRuleList> getMatchedCSSRules(Element*, con st String& pseudoElt) const = 0;
163
164 // WebKit animation extensions
165 virtual int requestAnimationFrame(RequestAnimationFrameCallback*) = 0;
166 virtual int webkitRequestAnimationFrame(RequestAnimationFrameCallback*) = 0;
167 virtual void cancelAnimationFrame(int id) = 0;
168
169 void captureEvents() { }
170 void releaseEvents() { }
171
172 // FIXME: Should this be returning DOMWindows?
173 virtual LocalDOMWindow* anonymousIndexedGetter(uint32_t) = 0;
174
175 virtual void postMessage(PassRefPtr<SerializedScriptValue> message, const Me ssagePortArray*, const String& targetOrigin, LocalDOMWindow* source, ExceptionSt ate&) = 0;
dcheng 2014/10/31 03:20:41 I can split this into a separate CL if it will mak
176
177 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend);
178 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration);
179 DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart);
180 DEFINE_ATTRIBUTE_EVENT_LISTENER(search);
181 DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend);
182 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel);
183
184 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimation Start);
185 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnima tionIteration);
186 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEn d);
187 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransition End);
188
189 DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange);
190 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart);
191 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove);
192 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend);
193 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel);
dcheng 2014/10/31 03:20:41 I feel like we could do a little better here--Remo
112 }; 194 };
113 195
114 } // namespace blink 196 } // namespace blink
115 197
116 #endif // DOMWindow_h 198 #endif // DOMWindow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698