Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef DOMWindow_h | 27 #ifndef DOMWindow_h |
| 28 #define DOMWindow_h | 28 #define DOMWindow_h |
| 29 | 29 |
| 30 #include "bindings/v8/ScriptWrappable.h" | 30 #include "bindings/v8/ScriptWrappable.h" |
| 31 #include "core/dom/EventTarget.h" | 31 #include "core/dom/EventTarget.h" |
| 32 #include "core/page/DOMWindowBase64.h" | |
| 32 #include "core/page/FrameDestructionObserver.h" | 33 #include "core/page/FrameDestructionObserver.h" |
| 33 #include "core/platform/Supplementable.h" | 34 #include "core/platform/Supplementable.h" |
| 34 | 35 |
| 35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 36 | 37 |
| 37 namespace WebCore { | 38 namespace WebCore { |
| 38 class BarProp; | 39 class BarProp; |
| 39 class CSSRuleList; | 40 class CSSRuleList; |
| 40 class CSSStyleDeclaration; | 41 class CSSStyleDeclaration; |
| 41 class CanvasRenderingContext2D; | 42 class CanvasRenderingContext2D; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 class DOMWindowCSS; | 81 class DOMWindowCSS; |
| 81 | 82 |
| 82 struct WindowFeatures; | 83 struct WindowFeatures; |
| 83 | 84 |
| 84 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; | 85 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; |
| 85 | 86 |
| 86 typedef int ExceptionCode; | 87 typedef int ExceptionCode; |
| 87 | 88 |
| 88 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBack ForwardList }; | 89 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBack ForwardList }; |
| 89 | 90 |
| 90 class DOMWindow : public RefCounted<DOMWindow>, public ScriptWrappable, publ ic EventTarget, public FrameDestructionObserver, public Supplementable<DOMWindow > { | 91 class DOMWindow : public RefCounted<DOMWindow>, public ScriptWrappable, publ ic EventTarget, public FrameDestructionObserver, public DOMWindowBase64, public Supplementable<DOMWindow> { |
|
abarth-chromium
2013/07/18 08:17:14
Why do we need to subclass? Can't we just use a p
| |
| 91 public: | 92 public: |
| 92 static PassRefPtr<DOMWindow> create(Frame* frame) { return adoptRef(new DOMWindow(frame)); } | 93 static PassRefPtr<DOMWindow> create(Frame* frame) { return adoptRef(new DOMWindow(frame)); } |
| 93 virtual ~DOMWindow(); | 94 virtual ~DOMWindow(); |
| 94 | 95 |
| 95 // In some rare cases, we'll re-used a DOMWindow for a new Document. For example, | 96 // In some rare cases, we'll re-used a DOMWindow for a new Document. For example, |
| 96 // when a script calls window.open("..."), the browser gives JavaScript a window | 97 // when a script calls window.open("..."), the browser gives JavaScript a window |
| 97 // synchronously but kicks off the load in the window asynchronously. We b sites | 98 // synchronously but kicks off the load in the window asynchronously. We b sites |
| 98 // expect that modifications that they make to the window object synchro nously | 99 // expect that modifications that they make to the window object synchro nously |
| 99 // won't be blown away when the network load commits. To make that happe n, we | 100 // won't be blown away when the network load commits. To make that happe n, we |
| 100 // "securely transition" the existing DOMWindow to the Document that res ults from | 101 // "securely transition" the existing DOMWindow to the Document that res ults from |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 PassRefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString, | 153 PassRefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString, |
| 153 DOMWindow* activeWindow, DOMWindow* firstWindow); | 154 DOMWindow* activeWindow, DOMWindow* firstWindow); |
| 154 | 155 |
| 155 typedef void (*PrepareDialogFunction)(DOMWindow*, void* context); | 156 typedef void (*PrepareDialogFunction)(DOMWindow*, void* context); |
| 156 void showModalDialog(const String& urlString, const String& dialogFeatur esString, | 157 void showModalDialog(const String& urlString, const String& dialogFeatur esString, |
| 157 DOMWindow* activeWindow, DOMWindow* firstWindow, PrepareDialogFuncti on, void* functionContext); | 158 DOMWindow* activeWindow, DOMWindow* firstWindow, PrepareDialogFuncti on, void* functionContext); |
| 158 | 159 |
| 159 void alert(const String& message); | 160 void alert(const String& message); |
| 160 bool confirm(const String& message); | 161 bool confirm(const String& message); |
| 161 String prompt(const String& message, const String& defaultValue); | 162 String prompt(const String& message, const String& defaultValue); |
| 162 String btoa(const String& stringToEncode, ExceptionCode&); | |
| 163 String atob(const String& encodedString, ExceptionCode&); | |
| 164 | 163 |
| 165 bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const; | 164 bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const; |
| 166 | 165 |
| 167 bool offscreenBuffering() const; | 166 bool offscreenBuffering() const; |
| 168 | 167 |
| 169 int outerHeight() const; | 168 int outerHeight() const; |
| 170 int outerWidth() const; | 169 int outerWidth() const; |
| 171 int innerHeight() const; | 170 int innerHeight() const; |
| 172 int innerWidth() const; | 171 int innerWidth() const; |
| 173 int screenX() const; | 172 int screenX() const; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 } | 451 } |
| 453 | 452 |
| 454 inline String DOMWindow::defaultStatus() const | 453 inline String DOMWindow::defaultStatus() const |
| 455 { | 454 { |
| 456 return m_defaultStatus; | 455 return m_defaultStatus; |
| 457 } | 456 } |
| 458 | 457 |
| 459 } // namespace WebCore | 458 } // namespace WebCore |
| 460 | 459 |
| 461 #endif // DOMWindow_h | 460 #endif // DOMWindow_h |
| OLD | NEW |