| Index: Source/core/frame/Frame.h
|
| diff --git a/Source/core/frame/Frame.h b/Source/core/frame/Frame.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a1a81200e747d210227d1693d378ef745a729eb3
|
| --- /dev/null
|
| +++ b/Source/core/frame/Frame.h
|
| @@ -0,0 +1,127 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef Frame_h
|
| +#define Frame_h
|
| +
|
| +#include "wtf/Forward.h"
|
| +#include "wtf/HashSet.h"
|
| +#include "wtf/RefCounted.h"
|
| +
|
| +namespace blink {
|
| +class WebLayer;
|
| +}
|
| +
|
| +namespace WebCore {
|
| +
|
| +class Document;
|
| +class DOMWindow;
|
| +class ChromeClient;
|
| +class FrameDestructionObserver;
|
| +class FrameHost;
|
| +class FrameLoaderClient;
|
| +class HTMLFrameOwnerElement;
|
| +class Page;
|
| +class RenderView;
|
| +class Settings;
|
| +
|
| +class FrameInit : public RefCounted<FrameInit> {
|
| +public:
|
| + // For creating a dummy Frame
|
| + static PassRefPtr<FrameInit> create(FrameHost* host, FrameLoaderClient* client)
|
| + {
|
| + return adoptRef(new FrameInit(host, client));
|
| + }
|
| +
|
| + void setFrameHost(FrameHost* host) { m_frameHost = host; }
|
| + FrameHost* frameHost() const { return m_frameHost; }
|
| +
|
| + void setFrameLoaderClient(FrameLoaderClient* client) { m_client = client; }
|
| + FrameLoaderClient* frameLoaderClient() const { return m_client; }
|
| +
|
| + void setOwnerElement(HTMLFrameOwnerElement* ownerElement) { m_ownerElement = ownerElement; }
|
| + HTMLFrameOwnerElement* ownerElement() const { return m_ownerElement; }
|
| +
|
| +protected:
|
| + FrameInit(FrameHost* host = 0, FrameLoaderClient* client = 0)
|
| + : m_client(client)
|
| + , m_frameHost(host)
|
| + , m_ownerElement(0)
|
| + {
|
| + }
|
| +
|
| +private:
|
| + FrameLoaderClient* m_client;
|
| + FrameHost* m_frameHost;
|
| + HTMLFrameOwnerElement* m_ownerElement;
|
| +};
|
| +
|
| +class Frame : public RefCounted<Frame> {
|
| +public:
|
| + virtual bool isLocalFrame() const { return false; }
|
| + virtual bool isRemoteFrame() const { return false; }
|
| +
|
| + virtual ~Frame();
|
| +
|
| + void addDestructionObserver(FrameDestructionObserver*);
|
| + void removeDestructionObserver(FrameDestructionObserver*);
|
| +
|
| + virtual void willDetachFrameHost();
|
| + virtual void detachFromFrameHost();
|
| +
|
| + // NOTE: Page is moving out of Blink up into the browser process as
|
| + // part of the site-isolation (out of process iframes) work.
|
| + // FrameHost should be used instead where possible.
|
| + Page* page() const;
|
| + FrameHost* host() const; // Null when the frame is detached.
|
| +
|
| + bool isMainFrame() const;
|
| +
|
| + virtual void setDOMWindow(PassRefPtr<DOMWindow>);
|
| + DOMWindow* domWindow() const;
|
| + Document* document() const;
|
| +
|
| + ChromeClient& chromeClient() const;
|
| +
|
| + RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
|
| +
|
| + int64_t frameID() const { return m_frameID; }
|
| +
|
| + // FIXME: These should move to RemoteFrame when that is instantiated.
|
| + void setRemotePlatformLayer(blink::WebLayer* remotePlatformLayer) { m_remotePlatformLayer = remotePlatformLayer; }
|
| + blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
|
| +
|
| +// ======== All public functions below this point are candidates to move out of Frame into another class. ========
|
| +
|
| + Settings* settings() const; // can be null
|
| +
|
| + double devicePixelRatio() const;
|
| +
|
| +// ========
|
| +
|
| +protected:
|
| + Frame(PassRefPtr<FrameInit>);
|
| +
|
| + RefPtr<FrameInit> m_frameInit;
|
| + FrameHost* m_host;
|
| +
|
| + RefPtr<DOMWindow> m_domWindow;
|
| +
|
| +private:
|
| +
|
| + HashSet<FrameDestructionObserver*> m_destructionObservers;
|
| +
|
| + // Temporary hack for history.
|
| + int64_t m_frameID;
|
| +
|
| + blink::WebLayer* m_remotePlatformLayer;
|
| +};
|
| +
|
| +inline DOMWindow* Frame::domWindow() const
|
| +{
|
| + return m_domWindow.get();
|
| +}
|
| +} // namespace WebCore
|
| +
|
| +#endif // Frame_h
|
|
|