Index: Source/core/frame/FrameHost.h |
diff --git a/Source/core/html/LinkImport.h b/Source/core/frame/FrameHost.h |
similarity index 55% |
copy from Source/core/html/LinkImport.h |
copy to Source/core/frame/FrameHost.h |
index 75e611d5fc71c7b03316be6118fe89eb7cde83e0..9b790be999129734b06bec082476481dbec6e36e 100644 |
--- a/Source/core/html/LinkImport.h |
+++ b/Source/core/frame/FrameHost.h |
@@ -28,50 +28,50 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef LinkImport_h |
-#define LinkImport_h |
+#ifndef FrameHost_h |
+#define FrameHost_h |
-#include "core/html/HTMLImportChildClient.h" |
-#include "core/html/LinkResource.h" |
#include "wtf/FastAllocBase.h" |
+#include "wtf/Noncopyable.h" |
#include "wtf/PassOwnPtr.h" |
-#include "wtf/RefPtr.h" |
namespace WebCore { |
-class Document; |
-class HTMLImportChild; |
+class Page; |
+class Chrome; |
+class Settings; |
-// |
-// A LinkResource subclasss used for @rel=import. |
-// |
-class LinkImport : public LinkResource, public HTMLImportChildClient { |
- WTF_MAKE_FAST_ALLOCATED; |
+// FrameHost is the set of global data shared between multiple frames |
+// and is provided by the embedder to each frame when created. |
+// FrameHost currently corresponds to the Page object in core/page |
+// however the concept of a Page is moving up out of Blink. |
+// In an out-of-process iframe world, a single Page may have |
+// multiple frames in different process, thus Page becomes a |
+// browser-level concept and Blink core/ only knows about its Frame (and FrameHost). |
+// Separating Page from the rest of core/ through this indirection |
+// allows us to slowly refactor Page without breaking the rest of core. |
+class FrameHost { |
+ WTF_MAKE_NONCOPYABLE(FrameHost); WTF_MAKE_FAST_ALLOCATED; |
public: |
+ static PassOwnPtr<FrameHost> create(Page&); |
- static PassOwnPtr<LinkImport> create(HTMLLinkElement* owner); |
+ // Careful: This function will eventually be removed. |
+ Page& page() const { return m_page; } |
- explicit LinkImport(HTMLLinkElement* owner); |
- virtual ~LinkImport(); |
+ Settings& settings() const; |
+ Chrome& chrome() const; |
- // LinkResource |
- virtual void process() OVERRIDE; |
- virtual Type type() const OVERRIDE { return Import; } |
- virtual void ownerRemoved() OVERRIDE; |
- virtual bool hasLoaded() const OVERRIDE; |
- |
- // HTMLImportChildClient |
- virtual void didFinish() OVERRIDE; |
- virtual void importWillBeDestroyed() OVERRIDE; |
- |
- Document* importedDocument() const; |
+ // Corresponds to pixel density of the device where this Page is |
+ // being displayed. In multi-monitor setups this can vary between pages. |
+ // This value does not account for Page zoom, use Frame::devicePixelRatio instead. |
+ float deviceScaleFactor() const; |
private: |
- void clear(); |
+ explicit FrameHost(Page&); |
- HTMLImportChild* m_loader; |
+ Page& m_page; |
}; |
-} // namespace WebCore |
+} |
-#endif // LinkImport_h |
+#endif // FrameHost_h |