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 TestPlugin_h | 5 #ifndef TestPlugin_h |
6 #define TestPlugin_h | 6 #define TestPlugin_h |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" | 12 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" |
12 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" | 13 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" |
13 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" | 14 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" |
14 #include "third_party/WebKit/public/platform/WebNonCopyable.h" | |
15 #include "third_party/WebKit/public/web/WebPlugin.h" | 15 #include "third_party/WebKit/public/web/WebPlugin.h" |
16 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 16 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
17 | 17 |
18 namespace WebTestRunner { | 18 namespace WebTestRunner { |
19 | 19 |
20 class WebTestDelegate; | 20 class WebTestDelegate; |
21 | 21 |
22 // A fake implemention of blink::WebPlugin for testing purposes. | 22 // A fake implemention of blink::WebPlugin for testing purposes. |
23 // | 23 // |
24 // It uses WebGraphicsContext3D to paint a scene consisiting of a primitive | 24 // It uses WebGraphicsContext3D to paint a scene consisiting of a primitive |
25 // over a background. The primitive and background can be customized using | 25 // over a background. The primitive and background can be customized using |
26 // the following plugin parameters: | 26 // the following plugin parameters: |
27 // primitive: none (default), triangle. | 27 // primitive: none (default), triangle. |
28 // background-color: black (default), red, green, blue. | 28 // background-color: black (default), red, green, blue. |
29 // primitive-color: black (default), red, green, blue. | 29 // primitive-color: black (default), red, green, blue. |
30 // opacity: [0.0 - 1.0]. Default is 1.0. | 30 // opacity: [0.0 - 1.0]. Default is 1.0. |
31 // | 31 // |
32 // Whether the plugin accepts touch events or not can be customized using the | 32 // Whether the plugin accepts touch events or not can be customized using the |
33 // 'accepts-touch' plugin parameter (defaults to false). | 33 // 'accepts-touch' plugin parameter (defaults to false). |
34 class TestPlugin : public blink::WebPlugin, public blink::WebExternalTextureLaye
rClient, public blink::WebNonCopyable { | 34 class TestPlugin : public blink::WebPlugin, public blink::WebExternalTextureLaye
rClient { |
35 public: | 35 public: |
36 static TestPlugin* create(blink::WebFrame*, const blink::WebPluginParams&, W
ebTestDelegate*); | 36 static TestPlugin* create(blink::WebFrame*, const blink::WebPluginParams&, W
ebTestDelegate*); |
37 virtual ~TestPlugin(); | 37 virtual ~TestPlugin(); |
38 | 38 |
39 static const blink::WebString& mimeType(); | 39 static const blink::WebString& mimeType(); |
40 | 40 |
41 // WebPlugin methods: | 41 // WebPlugin methods: |
42 virtual bool initialize(blink::WebPluginContainer*); | 42 virtual bool initialize(blink::WebPluginContainer*); |
43 virtual void destroy(); | 43 virtual void destroy(); |
44 virtual NPObject* scriptableObject() { return 0; } | 44 virtual NPObject* scriptableObject() { return 0; } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 unsigned m_framebuffer; | 123 unsigned m_framebuffer; |
124 Scene m_scene; | 124 Scene m_scene; |
125 scoped_ptr<blink::WebExternalTextureLayer> m_layer; | 125 scoped_ptr<blink::WebExternalTextureLayer> m_layer; |
126 | 126 |
127 blink::WebPluginContainer::TouchEventRequestType m_touchEventRequest; | 127 blink::WebPluginContainer::TouchEventRequestType m_touchEventRequest; |
128 // Requests touch events from the WebPluginContainerImpl multiple times to t
ickle webkit.org/b/108381 | 128 // Requests touch events from the WebPluginContainerImpl multiple times to t
ickle webkit.org/b/108381 |
129 bool m_reRequestTouchEvents; | 129 bool m_reRequestTouchEvents; |
130 bool m_printEventDetails; | 130 bool m_printEventDetails; |
131 bool m_printUserGestureStatus; | 131 bool m_printUserGestureStatus; |
132 bool m_canProcessDrag; | 132 bool m_canProcessDrag; |
| 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(TestPlugin); |
133 }; | 135 }; |
134 | 136 |
135 } | 137 } |
136 | 138 |
137 #endif // TestPlugin_h | 139 #endif // TestPlugin_h |
OLD | NEW |