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 | 11 |
11 namespace WebTestRunner { | 12 namespace WebTestRunner { |
12 | 13 |
13 // Templetized wrapper around RenderFrameImpl objects, which implement | 14 // Templetized wrapper around RenderFrameImpl objects, which implement |
14 // the WebFrameClient interface. | 15 // the WebFrameClient interface. |
15 template<class Base, typename P, typename R> | 16 template<class Base, typename P, typename R> |
16 class WebFrameTestProxy : public Base { | 17 class WebFrameTestProxy : public Base { |
17 public: | 18 public: |
18 WebFrameTestProxy(P p, R r) | 19 WebFrameTestProxy(P p, R r) |
19 : Base(p, r) | 20 : Base(p, r) |
(...skipping 14 matching lines...) Expand all Loading... |
34 | 35 |
35 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi
nParams& params) | 36 blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPlugi
nParams& params) |
36 { | 37 { |
37 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); | 38 blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); |
38 if (plugin) | 39 if (plugin) |
39 return plugin; | 40 return plugin; |
40 return Base::createPlugin(frame, params); | 41 return Base::createPlugin(frame, params); |
41 } | 42 } |
42 | 43 |
43 // WebFrameClient implementation. | 44 // WebFrameClient implementation. |
| 45 virtual bool canCreatePluginWithoutRenderer(const blink::WebString& mimeType
) |
| 46 { |
| 47 using blink::WebString; |
| 48 |
| 49 const CR_DEFINE_STATIC_LOCAL(WebString, suffix, ("-can-create-without-re
nderer")); |
| 50 return mimeType.utf8().find(suffix.utf8()) != std::string::npos; |
| 51 } |
44 virtual void didStartProvisionalLoad(blink::WebFrame* frame) | 52 virtual void didStartProvisionalLoad(blink::WebFrame* frame) |
45 { | 53 { |
46 if (m_version > 2) | 54 if (m_version > 2) |
47 m_baseProxy->didStartProvisionalLoad(frame); | 55 m_baseProxy->didStartProvisionalLoad(frame); |
48 Base::didStartProvisionalLoad(frame); | 56 Base::didStartProvisionalLoad(frame); |
49 } | 57 } |
50 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra
me) | 58 virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* fra
me) |
51 { | 59 { |
52 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); | 60 m_baseProxy->didReceiveServerRedirectForProvisionalLoad(frame); |
53 Base::didReceiveServerRedirectForProvisionalLoad(frame); | 61 Base::didReceiveServerRedirectForProvisionalLoad(frame); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // It is used instead of a #define and is set by layouttest_support when | 156 // It is used instead of a #define and is set by layouttest_support when |
149 // creating this object. | 157 // creating this object. |
150 int m_version; | 158 int m_version; |
151 | 159 |
152 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 160 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
153 }; | 161 }; |
154 | 162 |
155 } | 163 } |
156 | 164 |
157 #endif // WebTestProxy_h | 165 #endif // WebTestProxy_h |
OLD | NEW |