Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ |
| 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 9 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
| 10 #include "third_party/WebKit/public/platform/WebString.h" | 10 #include "third_party/WebKit/public/platform/WebString.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi nParams& params) | 36 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi nParams& params) |
| 37 { | 37 { |
| 38 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); | 38 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); |
| 39 if (plugin) | 39 if (plugin) |
| 40 return plugin; | 40 return plugin; |
| 41 return Base::createPlugin(frame, params); | 41 return Base::createPlugin(frame, params); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // WebFrameClient implementation. | 44 // WebFrameClient implementation. |
| 45 virtual bool canCreatePluginWithoutRenderer(const blink::WebString& mimeType ) | 45 virtual void loadURLExternally(blink::WebFrame* frame, const blink::WebURLRe quest& request, blink::WebNavigationPolicy policy, const blink::WebString& sugge sted_name) OVERRIDE |
| 46 { | 46 { |
| 47 using blink::WebString; | 47 m_baseProxy->loadURLExternally(frame, request, policy, suggested_name); |
| 48 | 48 Base::loadURLExternally(frame, request, policy, suggested_name); |
| 49 const CR_DEFINE_STATIC_LOCAL(WebString, suffix, ("-can-create-without-re nderer")); | |
| 50 return mimeType.utf8().find(suffix.utf8()) != std::string::npos; | |
| 51 } | 49 } |
| 52 virtual void didStartProvisionalLoad(blink::WebFrame* frame) | 50 virtual void didStartProvisionalLoad(blink::WebFrame* frame) OVERRIDE |
|
jochen (gone - plz use gerrit)
2014/03/16 12:55:45
we don't put OVERRIDE on implementations of the bl
| |
| 53 { | 51 { |
| 54 if (m_version > 2) | 52 if (m_version > 2) |
| 55 m_baseProxy->didStartProvisionalLoad(frame); | 53 m_baseProxy->didStartProvisionalLoad(frame); |
| 56 Base::didStartProvisionalLoad(frame); | 54 Base::didStartProvisionalLoad(frame); |
| 57 } | 55 } |
| 58 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra me) | 56 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra me) OVERRIDE |
| 59 { | 57 { |
| 60 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); | 58 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); |
| 61 Base::didReceiveServerRedirectForProvisionalLoad(frame); | 59 Base::didReceiveServerRedirectForProvisionalLoad(frame); |
| 62 } | 60 } |
| 63 virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::Web URLError& error) | 61 virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::Web URLError& error) OVERRIDE |
| 64 { | 62 { |
| 65 Base::didFailProvisionalLoad(frame, error); | 63 Base::didFailProvisionalLoad(frame, error); |
| 66 } | 64 } |
| 67 virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavi gation) | 65 virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavi gation) OVERRIDE |
| 68 { | 66 { |
| 69 Base::didCommitProvisionalLoad(frame, isNewNavigation); | 67 Base::didCommitProvisionalLoad(frame, isNewNavigation); |
| 70 } | 68 } |
| 71 virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) | 69 virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) OVERRIDE |
| 72 { | 70 { |
| 73 Base::didReceiveTitle(frame, title, direction); | 71 Base::didReceiveTitle(frame, title, direction); |
| 74 } | 72 } |
| 75 virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type i conType) | 73 virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type i conType) OVERRIDE |
| 76 { | 74 { |
| 77 Base::didChangeIcon(frame, iconType); | 75 Base::didChangeIcon(frame, iconType); |
| 78 } | 76 } |
| 79 virtual void didFinishDocumentLoad(blink::WebFrame* frame) | 77 virtual void didFinishDocumentLoad(blink::WebFrame* frame) OVERRIDE |
| 80 { | 78 { |
| 81 Base::didFinishDocumentLoad(frame); | 79 Base::didFinishDocumentLoad(frame); |
| 82 } | 80 } |
| 83 virtual void didHandleOnloadEvents(blink::WebFrame* frame) | 81 virtual void didHandleOnloadEvents(blink::WebFrame* frame) OVERRIDE |
| 84 { | 82 { |
| 85 Base::didHandleOnloadEvents(frame); | 83 Base::didHandleOnloadEvents(frame); |
| 86 } | 84 } |
| 87 virtual void didFailLoad(blink::WebFrame* frame, const blink::WebURLError& e rror) | 85 virtual void didFailLoad(blink::WebFrame* frame, const blink::WebURLError& e rror) OVERRIDE |
| 88 { | 86 { |
| 89 Base::didFailLoad(frame, error); | 87 Base::didFailLoad(frame, error); |
| 90 } | 88 } |
| 91 virtual void didFinishLoad(blink::WebFrame* frame) | 89 virtual void didFinishLoad(blink::WebFrame* frame) OVERRIDE |
| 92 { | 90 { |
| 93 Base::didFinishLoad(frame); | 91 Base::didFinishLoad(frame); |
| 94 } | 92 } |
| 95 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat a) { | 93 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat a) OVERRIDE |
| 94 { | |
| 96 m_baseProxy->showContextMenu(Base::GetWebFrame(), contextMenuData); | 95 m_baseProxy->showContextMenu(Base::GetWebFrame(), contextMenuData); |
| 97 Base::showContextMenu(contextMenuData); | 96 Base::showContextMenu(contextMenuData); |
| 98 } | 97 } |
| 99 virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insec ureURL, bool didBlockEntirePage) | 98 virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insec ureURL, bool didBlockEntirePage) OVERRIDE |
| 100 { | 99 { |
| 101 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 100 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 102 // into the base proxy. | 101 // into the base proxy. |
| 103 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); | 102 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); |
| 104 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); | 103 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); |
| 105 } | 104 } |
| 106 virtual void didDispatchPingLoader(blink::WebFrame* frame, const blink::WebU RL& url) | 105 virtual void didDispatchPingLoader(blink::WebFrame* frame, const blink::WebU RL& url) OVERRIDE |
| 107 { | 106 { |
| 108 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 107 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 109 // into the base proxy. | 108 // into the base proxy. |
| 110 m_baseProxy->didDispatchPingLoader(frame, url); | 109 m_baseProxy->didDispatchPingLoader(frame, url); |
| 111 Base::didDispatchPingLoader(frame, url); | 110 Base::didDispatchPingLoader(frame, url); |
| 112 } | 111 } |
| 113 virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCac hedURLRequest& request) | 112 virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCac hedURLRequest& request) OVERRIDE |
| 114 { | 113 { |
| 115 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 114 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 116 // into the base proxy. | 115 // into the base proxy. |
| 117 m_baseProxy->willRequestResource(frame, request); | 116 m_baseProxy->willRequestResource(frame, request); |
| 118 Base::willRequestResource(frame, request); | 117 Base::willRequestResource(frame, request); |
| 119 } | 118 } |
| 120 virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSourc e* ds) | 119 virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSourc e* ds) OVERRIDE |
| 121 { | 120 { |
| 122 Base::didCreateDataSource(frame, ds); | 121 Base::didCreateDataSource(frame, ds); |
| 123 } | 122 } |
| 124 virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, bl ink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse) | 123 virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, bl ink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse) OVER RIDE |
| 125 { | 124 { |
| 126 m_baseProxy->willSendRequest(frame, identifier, request, redirectRespons e); | 125 m_baseProxy->willSendRequest(frame, identifier, request, redirectRespons e); |
| 127 Base::willSendRequest(frame, identifier, request, redirectResponse); | 126 Base::willSendRequest(frame, identifier, request, redirectResponse); |
| 128 } | 127 } |
| 129 virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response) | 128 virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response) OVERRIDE |
| 130 { | 129 { |
| 131 m_baseProxy->didReceiveResponse(frame, identifier, response); | 130 m_baseProxy->didReceiveResponse(frame, identifier, response); |
| 132 Base::didReceiveResponse(frame, identifier, response); | 131 Base::didReceiveResponse(frame, identifier, response); |
| 133 } | 132 } |
| 134 virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned iden tifier, const blink::WebURLRequest::Priority& priority) | 133 virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned iden tifier, const blink::WebURLRequest::Priority& priority) OVERRIDE |
| 135 { | 134 { |
| 136 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 135 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 137 // into the base proxy. | 136 // into the base proxy. |
| 138 m_baseProxy->didChangeResourcePriority(frame, identifier, priority); | 137 m_baseProxy->didChangeResourcePriority(frame, identifier, priority); |
| 139 Base::didChangeResourcePriority(frame, identifier, priority); | 138 Base::didChangeResourcePriority(frame, identifier, priority); |
| 140 } | 139 } |
| 141 virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifi er) | 140 virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifi er) OVERRIDE |
| 142 { | 141 { |
| 143 Base::didFinishResourceLoad(frame, identifier); | 142 Base::didFinishResourceLoad(frame, identifier); |
| 144 } | 143 } |
| 145 virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame * frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolic y, bool isRedirect) | 144 virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame * frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolic y, bool isRedirect) OVERRIDE |
| 146 { | 145 { |
| 147 blink::WebNavigationPolicy policy = m_baseProxy->decidePolicyForNavigati on(frame, extraData, request, type, defaultPolicy, isRedirect); | 146 blink::WebNavigationPolicy policy = m_baseProxy->decidePolicyForNavigati on(frame, extraData, request, type, defaultPolicy, isRedirect); |
| 148 if (policy == blink::WebNavigationPolicyIgnore) | 147 if (policy == blink::WebNavigationPolicyIgnore) |
| 149 return policy; | 148 return policy; |
| 150 | 149 |
| 151 return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); | 150 return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); |
| 152 } | 151 } |
| 153 virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMess ageEvent event) | 152 virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMess ageEvent event) OVERRIDE |
| 154 { | 153 { |
| 155 if (m_baseProxy->willCheckAndDispatchMessageEvent(sourceFrame, targetFra me, target, event)) | 154 if (m_baseProxy->willCheckAndDispatchMessageEvent(sourceFrame, targetFra me, target, event)) |
| 156 return true; | 155 return true; |
| 157 return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); | 156 return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); |
| 158 } | 157 } |
| 159 | 158 |
| 160 private: | 159 private: |
| 161 WebTestProxyBase* m_baseProxy; | 160 WebTestProxyBase* m_baseProxy; |
| 162 | 161 |
| 163 // This is used to incrementally change code between Blink and Chromium. | 162 // This is used to incrementally change code between Blink and Chromium. |
| 164 // It is used instead of a #define and is set by layouttest_support when | 163 // It is used instead of a #define and is set by layouttest_support when |
| 165 // creating this object. | 164 // creating this object. |
| 166 int m_version; | 165 int m_version; |
| 167 | 166 |
| 168 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 167 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
| 169 }; | 168 }; |
| 170 | 169 |
| 171 } | 170 } |
| 172 | 171 |
| 173 #endif // WebTestProxy_h | 172 #endif // WebTestProxy_h |
| OLD | NEW |