| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebFrameTestProxy_h | 31 #ifndef WebFrameTestProxy_h |
| 32 #define WebFrameTestProxy_h | 32 #define WebFrameTestProxy_h |
| 33 | 33 |
| 34 #include "WebTestProxy.h" | 34 #include "WebTestProxy.h" |
| 35 #include "public/platform/WebNonCopyable.h" | 35 #include "public/platform/WebNonCopyable.h" |
| 36 #include "public/platform/WebString.h" |
| 36 | 37 |
| 37 namespace WebTestRunner { | 38 namespace WebTestRunner { |
| 38 | 39 |
| 39 // Templetized wrapper around RenderFrameImpl objects, which implement | 40 // Templetized wrapper around RenderFrameImpl objects, which implement |
| 40 // the WebFrameClient interface. | 41 // the WebFrameClient interface. |
| 41 template<class Base, typename P, typename R> | 42 template<class Base, typename P, typename R> |
| 42 class WebFrameTestProxy : public Base, public blink::WebNonCopyable { | 43 class WebFrameTestProxy : public Base, public blink::WebNonCopyable { |
| 43 public: | 44 public: |
| 44 WebFrameTestProxy(P p, R r) | 45 WebFrameTestProxy(P p, R r) |
| 45 : Base(p, r) | 46 : Base(p, r) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 | 61 |
| 61 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi
nParams& params) | 62 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi
nParams& params) |
| 62 { | 63 { |
| 63 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); | 64 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); |
| 64 if (plugin) | 65 if (plugin) |
| 65 return plugin; | 66 return plugin; |
| 66 return Base::createPlugin(frame, params); | 67 return Base::createPlugin(frame, params); |
| 67 } | 68 } |
| 68 | 69 |
| 69 // WebFrameClient implementation. | 70 // WebFrameClient implementation. |
| 71 virtual bool canCreatePluginWithoutRenderer(const blink::WebString& mimeType
) |
| 72 { |
| 73 using blink::WebString; |
| 74 |
| 75 static const WebString suffix = WebString::fromUTF8("-can-create-without
-renderer"); |
| 76 return mimeType.utf8().find(suffix.utf8()) != std::string::npos; |
| 77 } |
| 70 virtual void didStartProvisionalLoad(blink::WebFrame* frame) | 78 virtual void didStartProvisionalLoad(blink::WebFrame* frame) |
| 71 { | 79 { |
| 72 if (m_version > 2) | 80 if (m_version > 2) |
| 73 m_baseProxy->didStartProvisionalLoad(frame); | 81 m_baseProxy->didStartProvisionalLoad(frame); |
| 74 Base::didStartProvisionalLoad(frame); | 82 Base::didStartProvisionalLoad(frame); |
| 75 } | 83 } |
| 76 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra
me) | 84 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra
me) |
| 77 { | 85 { |
| 78 Base::didReceiveServerRedirectForProvisionalLoad(frame); | 86 Base::didReceiveServerRedirectForProvisionalLoad(frame); |
| 79 } | 87 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 179 |
| 172 // This is used to incrementally change code between Blink and Chromium. | 180 // 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 | 181 // It is used instead of a #define and is set by layouttest_support when |
| 174 // creating this object. | 182 // creating this object. |
| 175 int m_version; | 183 int m_version; |
| 176 }; | 184 }; |
| 177 | 185 |
| 178 } | 186 } |
| 179 | 187 |
| 180 #endif // WebTestProxy_h | 188 #endif // WebTestProxy_h |
| OLD | NEW |