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 15 matching lines...) Expand all Loading... | |
| 26 void setBaseProxy(WebTestProxyBase* proxy) | 26 void setBaseProxy(WebTestProxyBase* proxy) |
| 27 { | 27 { |
| 28 m_baseProxy = proxy; | 28 m_baseProxy = proxy; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void setVersion(int version) | 31 void setVersion(int version) |
| 32 { | 32 { |
| 33 m_version = version; | 33 m_version = version; |
| 34 } | 34 } |
| 35 | 35 |
| 36 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi nParams& params) | 36 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
|
Charlie Reis
2014/04/03 00:37:11
Jochen: Why are these files using Blink style insi
dcheng
2014/04/03 20:39:57
Yeah, I used clang-format to wrap overly long line
Charlie Reis
2014/04/03 20:56:31
I defer to Jochen there. I expect they should be
jochen (gone - plz use gerrit)
2014/04/04 09:01:39
agreed.
Please consider moving files in test_runn
| |
| 37 { | 37 const blink::WebPluginParams& params) { |
| 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 bool canCreatePluginWithoutRenderer(const blink::WebString& mimeType ) |
| 46 { | 46 { |
| 47 using blink::WebString; | 47 using blink::WebString; |
| 48 | 48 |
| 49 const CR_DEFINE_STATIC_LOCAL(WebString, suffix, ("-can-create-without-re nderer")); | 49 const CR_DEFINE_STATIC_LOCAL(WebString, suffix, ("-can-create-without-re nderer")); |
| 50 return mimeType.utf8().find(suffix.utf8()) != std::string::npos; | 50 return mimeType.utf8().find(suffix.utf8()) != std::string::npos; |
| 51 } | 51 } |
| 52 virtual void didStartProvisionalLoad(blink::WebFrame* frame) | 52 virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame) { |
| 53 { | |
| 54 if (m_version > 2) | 53 if (m_version > 2) |
| 55 m_baseProxy->didStartProvisionalLoad(frame); | 54 m_baseProxy->didStartProvisionalLoad(frame); |
| 56 Base::didStartProvisionalLoad(frame); | 55 Base::didStartProvisionalLoad(frame); |
| 57 } | 56 } |
| 58 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra me) | 57 virtual void didReceiveServerRedirectForProvisionalLoad( |
| 59 { | 58 blink::WebLocalFrame* frame) { |
| 60 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); | 59 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); |
| 61 Base::didReceiveServerRedirectForProvisionalLoad(frame); | 60 Base::didReceiveServerRedirectForProvisionalLoad(frame); |
| 62 } | 61 } |
| 63 virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::Web URLError& error) | 62 virtual void didFailProvisionalLoad(blink::WebLocalFrame* frame, |
| 64 { | 63 const blink::WebURLError& error) { |
| 65 Base::didFailProvisionalLoad(frame, error); | 64 Base::didFailProvisionalLoad(frame, error); |
| 66 } | 65 } |
| 67 virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavi gation) | 66 virtual void didCommitProvisionalLoad(blink::WebLocalFrame* frame, |
| 68 { | 67 bool isNewNavigation) { |
| 69 Base::didCommitProvisionalLoad(frame, isNewNavigation); | 68 Base::didCommitProvisionalLoad(frame, isNewNavigation); |
| 70 } | 69 } |
| 71 virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) | 70 virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
| 72 { | 71 const blink::WebString& title, |
| 72 blink::WebTextDirection direction) { | |
| 73 Base::didReceiveTitle(frame, title, direction); | 73 Base::didReceiveTitle(frame, title, direction); |
| 74 } | 74 } |
| 75 virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type i conType) | 75 virtual void didChangeIcon(blink::WebLocalFrame* frame, |
| 76 { | 76 blink::WebIconURL::Type iconType) { |
| 77 Base::didChangeIcon(frame, iconType); | 77 Base::didChangeIcon(frame, iconType); |
| 78 } | 78 } |
| 79 virtual void didFinishDocumentLoad(blink::WebFrame* frame) | 79 virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame) { |
| 80 { | |
| 81 Base::didFinishDocumentLoad(frame); | 80 Base::didFinishDocumentLoad(frame); |
| 82 } | 81 } |
| 83 virtual void didHandleOnloadEvents(blink::WebFrame* frame) | 82 virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame) { |
| 84 { | |
| 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::WebLocalFrame* frame, |
| 88 { | 86 const blink::WebURLError& error) { |
| 89 Base::didFailLoad(frame, error); | 87 Base::didFailLoad(frame, error); |
| 90 } | 88 } |
| 91 virtual void didFinishLoad(blink::WebFrame* frame) | 89 virtual void didFinishLoad(blink::WebLocalFrame* frame) { |
| 92 { | |
| 93 Base::didFinishLoad(frame); | 90 Base::didFinishLoad(frame); |
| 94 } | 91 } |
| 95 virtual void didChangeSelection(bool is_selection_empty) { | 92 virtual void didChangeSelection(bool is_selection_empty) { |
| 96 m_baseProxy->didChangeSelection(is_selection_empty); | 93 m_baseProxy->didChangeSelection(is_selection_empty); |
| 97 Base::didChangeSelection(is_selection_empty); | 94 Base::didChangeSelection(is_selection_empty); |
| 98 } | 95 } |
| 99 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat a) { | 96 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat a) { |
| 100 m_baseProxy->showContextMenu(Base::GetWebFrame(), contextMenuData); | 97 m_baseProxy->showContextMenu(Base::GetWebFrame()->toWebLocalFrame(), |
| 98 contextMenuData); | |
| 101 Base::showContextMenu(contextMenuData); | 99 Base::showContextMenu(contextMenuData); |
| 102 } | 100 } |
| 103 virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insec ureURL, bool didBlockEntirePage) | 101 virtual void didDetectXSS(blink::WebLocalFrame* frame, |
| 104 { | 102 const blink::WebURL& insecureURL, |
| 103 bool didBlockEntirePage) { | |
| 105 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 104 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 106 // into the base proxy. | 105 // into the base proxy. |
| 107 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); | 106 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); |
| 108 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); | 107 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); |
| 109 } | 108 } |
| 110 virtual void didDispatchPingLoader(blink::WebFrame* frame, const blink::WebU RL& url) | 109 virtual void didDispatchPingLoader(blink::WebLocalFrame* frame, |
| 111 { | 110 const blink::WebURL& url) { |
| 112 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 111 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 113 // into the base proxy. | 112 // into the base proxy. |
| 114 m_baseProxy->didDispatchPingLoader(frame, url); | 113 m_baseProxy->didDispatchPingLoader(frame, url); |
| 115 Base::didDispatchPingLoader(frame, url); | 114 Base::didDispatchPingLoader(frame, url); |
| 116 } | 115 } |
| 117 virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCac hedURLRequest& request) | 116 virtual void willRequestResource( |
| 118 { | 117 blink::WebLocalFrame* frame, |
| 118 const blink::WebCachedURLRequest& request) { | |
| 119 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 119 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 120 // into the base proxy. | 120 // into the base proxy. |
| 121 m_baseProxy->willRequestResource(frame, request); | 121 m_baseProxy->willRequestResource(frame, request); |
| 122 Base::willRequestResource(frame, request); | 122 Base::willRequestResource(frame, request); |
| 123 } | 123 } |
| 124 virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSourc e* ds) | 124 virtual void didCreateDataSource(blink::WebLocalFrame* frame, |
| 125 { | 125 blink::WebDataSource* ds) { |
| 126 Base::didCreateDataSource(frame, ds); | 126 Base::didCreateDataSource(frame, ds); |
| 127 } | 127 } |
| 128 virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, bl ink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse) | 128 virtual void willSendRequest( |
| 129 { | 129 blink::WebLocalFrame* frame, |
| 130 unsigned identifier, | |
| 131 blink::WebURLRequest& request, | |
| 132 const blink::WebURLResponse& redirectResponse) { | |
| 130 m_baseProxy->willSendRequest(frame, identifier, request, redirectRespons e); | 133 m_baseProxy->willSendRequest(frame, identifier, request, redirectRespons e); |
| 131 Base::willSendRequest(frame, identifier, request, redirectResponse); | 134 Base::willSendRequest(frame, identifier, request, redirectResponse); |
| 132 } | 135 } |
| 133 virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response) | 136 virtual void didReceiveResponse(blink::WebLocalFrame* frame, |
| 134 { | 137 unsigned identifier, |
| 138 const blink::WebURLResponse& response) { | |
| 135 m_baseProxy->didReceiveResponse(frame, identifier, response); | 139 m_baseProxy->didReceiveResponse(frame, identifier, response); |
| 136 Base::didReceiveResponse(frame, identifier, response); | 140 Base::didReceiveResponse(frame, identifier, response); |
| 137 } | 141 } |
| 138 virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned iden tifier, const blink::WebURLRequest::Priority& priority) | 142 virtual void didChangeResourcePriority( |
| 139 { | 143 blink::WebLocalFrame* frame, |
| 144 unsigned identifier, | |
| 145 const blink::WebURLRequest::Priority& priority) { | |
| 140 // This is not implemented in RenderFrameImpl, so need to explicitly cal l | 146 // This is not implemented in RenderFrameImpl, so need to explicitly cal l |
| 141 // into the base proxy. | 147 // into the base proxy. |
| 142 m_baseProxy->didChangeResourcePriority(frame, identifier, priority); | 148 m_baseProxy->didChangeResourcePriority(frame, identifier, priority); |
| 143 Base::didChangeResourcePriority(frame, identifier, priority); | 149 Base::didChangeResourcePriority(frame, identifier, priority); |
| 144 } | 150 } |
| 145 virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifi er) | 151 virtual void didFinishResourceLoad(blink::WebLocalFrame* frame, |
| 146 { | 152 unsigned identifier) { |
| 147 Base::didFinishResourceLoad(frame, identifier); | 153 Base::didFinishResourceLoad(frame, identifier); |
| 148 } | 154 } |
| 149 virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame * frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolic y, bool isRedirect) | 155 virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
| 150 { | 156 blink::WebLocalFrame* frame, |
| 157 blink::WebDataSource::ExtraData* extraData, | |
| 158 const blink::WebURLRequest& request, | |
| 159 blink::WebNavigationType type, | |
| 160 blink::WebNavigationPolicy defaultPolicy, | |
| 161 bool isRedirect) { | |
| 151 blink::WebNavigationPolicy policy = m_baseProxy->decidePolicyForNavigati on(frame, extraData, request, type, defaultPolicy, isRedirect); | 162 blink::WebNavigationPolicy policy = m_baseProxy->decidePolicyForNavigati on(frame, extraData, request, type, defaultPolicy, isRedirect); |
| 152 if (policy == blink::WebNavigationPolicyIgnore) | 163 if (policy == blink::WebNavigationPolicyIgnore) |
| 153 return policy; | 164 return policy; |
| 154 | 165 |
| 155 return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); | 166 return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); |
| 156 } | 167 } |
| 157 virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMess ageEvent event) | 168 virtual bool willCheckAndDispatchMessageEvent( |
| 158 { | 169 blink::WebLocalFrame* sourceFrame, |
| 170 blink::WebFrame* targetFrame, | |
| 171 blink::WebSecurityOrigin target, | |
| 172 blink::WebDOMMessageEvent event) { | |
| 159 if (m_baseProxy->willCheckAndDispatchMessageEvent(sourceFrame, targetFra me, target, event)) | 173 if (m_baseProxy->willCheckAndDispatchMessageEvent(sourceFrame, targetFra me, target, event)) |
| 160 return true; | 174 return true; |
| 161 return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); | 175 return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); |
| 162 } | 176 } |
| 163 virtual void didStopLoading() | 177 virtual void didStopLoading() |
| 164 { | 178 { |
| 165 m_baseProxy->didStopLoading(); | 179 m_baseProxy->didStopLoading(); |
| 166 Base::didStopLoading(); | 180 Base::didStopLoading(); |
| 167 } | 181 } |
| 168 | 182 |
| 169 private: | 183 private: |
| 170 WebTestProxyBase* m_baseProxy; | 184 WebTestProxyBase* m_baseProxy; |
| 171 | 185 |
| 172 // This is used to incrementally change code between Blink and Chromium. | 186 // This is used to incrementally change code between Blink and Chromium. |
| 173 // It is used instead of a #define and is set by layouttest_support when | 187 // It is used instead of a #define and is set by layouttest_support when |
| 174 // creating this object. | 188 // creating this object. |
| 175 int m_version; | 189 int m_version; |
| 176 | 190 |
| 177 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 191 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
| 178 }; | 192 }; |
| 179 | 193 |
| 180 } | 194 } |
| 181 | 195 |
| 182 #endif // WebTestProxy_h | 196 #endif // WebTestProxy_h |
| OLD | NEW |