FrameLoadDelegate.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  14. * its contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  18. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  21. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. #ifndef FrameLoadDelegate_h
  29. #define FrameLoadDelegate_h
  30. #include <WebKit/WebKit.h>
  31. #include <wtf/OwnPtr.h>
  32. class AccessibilityController;
  33. class TextInputController;
  34. class GCController;
  35. class FrameLoadDelegate : public IWebFrameLoadDelegate, public IWebFrameLoadDelegatePrivate2 {
  36. public:
  37. FrameLoadDelegate();
  38. virtual ~FrameLoadDelegate();
  39. void processWork();
  40. void resetToConsistentState();
  41. AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
  42. // IUnknown
  43. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
  44. virtual ULONG STDMETHODCALLTYPE AddRef(void);
  45. virtual ULONG STDMETHODCALLTYPE Release(void);
  46. // IWebFrameLoadDelegate
  47. virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
  48. /* [in] */ IWebView *webView,
  49. /* [in] */ IWebFrame *frame);
  50. virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
  51. /* [in] */ IWebView *webView,
  52. /* [in] */ IWebFrame *frame);
  53. virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(
  54. /* [in] */ IWebView *webView,
  55. /* [in] */ IWebError *error,
  56. /* [in] */ IWebFrame *frame);
  57. virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
  58. /* [in] */ IWebView *webView,
  59. /* [in] */ IWebFrame *frame);
  60. virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
  61. /* [in] */ IWebView *webView,
  62. /* [in] */ BSTR title,
  63. /* [in] */ IWebFrame *frame);
  64. virtual HRESULT STDMETHODCALLTYPE didChangeIcons(
  65. /* [in] */ IWebView *webView,
  66. /* [in] */ IWebFrame *frame);
  67. virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
  68. /* [in] */ IWebView *webView,
  69. /* [in] */ OLE_HANDLE image,
  70. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  71. virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
  72. /* [in] */ IWebView *webView,
  73. /* [in] */ IWebFrame *frame);
  74. virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
  75. /* [in] */ IWebView *webView,
  76. /* [in] */ IWebError *error,
  77. /* [in] */ IWebFrame *forFrame);
  78. virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
  79. /* [in] */ IWebView *webView,
  80. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  81. virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
  82. /* [in] */ IWebView *webView,
  83. /* [in] */ BSTR url,
  84. /* [in] */ double delaySeconds,
  85. /* [in] */ DATE fireDate,
  86. /* [in] */ IWebFrame *frame);
  87. virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
  88. /* [in] */ IWebView *webView,
  89. /* [in] */ IWebFrame *frame);
  90. virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
  91. /* [in] */ IWebView *webView,
  92. /* [in] */ IWebFrame *frame);
  93. virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
  94. /* [in] */ IWebView *sender,
  95. /* [in] */ JSContextRef context,
  96. /* [in] */ JSObjectRef windowObject) { return E_NOTIMPL; }
  97. virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
  98. /* [in] */ IWebView* webView,
  99. /* [in] */ JSContextRef context,
  100. /* [in] */ JSObjectRef windowObject,
  101. /* [in] */ IWebFrame* frame);
  102. // IWebFrameLoadDelegatePrivate
  103. virtual HRESULT STDMETHODCALLTYPE didFinishDocumentLoadForFrame(
  104. /* [in] */ IWebView *sender,
  105. /* [in] */ IWebFrame *frame);
  106. virtual HRESULT STDMETHODCALLTYPE didFirstLayoutInFrame(
  107. /* [in] */ IWebView *sender,
  108. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  109. virtual HRESULT STDMETHODCALLTYPE didHandleOnloadEventsForFrame(
  110. /* [in] */ IWebView *sender,
  111. /* [in] */ IWebFrame *frame);
  112. virtual HRESULT STDMETHODCALLTYPE didFirstVisuallyNonEmptyLayoutInFrame(
  113. /* [in] */ IWebView *sender,
  114. /* [in] */ IWebFrame *frame);
  115. // IWebFrameLoadDelegatePrivate2
  116. virtual HRESULT STDMETHODCALLTYPE didDisplayInsecureContent(
  117. /* [in] */ IWebView *sender);
  118. virtual HRESULT STDMETHODCALLTYPE didRunInsecureContent(
  119. /* [in] */ IWebView *sender,
  120. /* [in] */ IWebSecurityOrigin *origin);
  121. virtual HRESULT STDMETHODCALLTYPE didClearWindowObjectForFrameInScriptWorld(IWebView*, IWebFrame*, IWebScriptWorld*);
  122. virtual HRESULT STDMETHODCALLTYPE didPushStateWithinPageForFrame(
  123. /* [in] */ IWebView *sender,
  124. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  125. virtual HRESULT STDMETHODCALLTYPE didReplaceStateWithinPageForFrame(
  126. /* [in] */ IWebView *sender,
  127. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  128. virtual HRESULT STDMETHODCALLTYPE didPopStateWithinPageForFrame(
  129. /* [in] */ IWebView *sender,
  130. /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
  131. private:
  132. void didClearWindowObjectForFrameInIsolatedWorld(IWebFrame*, IWebScriptWorld*);
  133. void didClearWindowObjectForFrameInStandardWorld(IWebFrame*);
  134. void locationChangeDone(IWebError*, IWebFrame*);
  135. ULONG m_refCount;
  136. OwnPtr<GCController> m_gcController;
  137. OwnPtr<AccessibilityController> m_accessibilityController;
  138. OwnPtr<TextInputController> m_textInputController;
  139. };
  140. #endif // FrameLoadDelegate_h