OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 24 matching lines...) Expand all Loading... |
35 #include <wtf/OwnPtr.h> | 35 #include <wtf/OwnPtr.h> |
36 #include <wtf/RefCounted.h> | 36 #include <wtf/RefCounted.h> |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 class Page; | 39 class Page; |
40 } | 40 } |
41 | 41 |
42 namespace WebKit { | 42 namespace WebKit { |
43 | 43 |
44 class HelperPluginChromeClient; | 44 class HelperPluginChromeClient; |
| 45 class WebDocument; |
| 46 class WebFrame; |
45 class WebViewImpl; | 47 class WebViewImpl; |
46 class WebWidgetClient; | 48 class WebWidgetClient; |
47 | 49 |
48 // Hosts a simple page that instantiates a plugin using an <object> tag. | 50 // Hosts a simple page that instantiates a plugin using an <object> tag. |
49 // The widget is offscreen, and the plugin will not receive painting, resize, et
c. events. | 51 // The widget is offscreen, and the plugin will not receive painting, resize, et
c. events. |
50 class WebHelperPluginImpl : public WebHelperPlugin, | 52 class WebHelperPluginImpl : public WebHelperPlugin, |
51 public RefCounted<WebHelperPluginImpl> { | 53 public RefCounted<WebHelperPluginImpl> { |
52 WTF_MAKE_NONCOPYABLE(WebHelperPluginImpl); | 54 WTF_MAKE_NONCOPYABLE(WebHelperPluginImpl); |
53 WTF_MAKE_FAST_ALLOCATED; | 55 WTF_MAKE_FAST_ALLOCATED; |
54 | 56 |
55 public: | 57 public: |
56 virtual ~WebHelperPluginImpl(); | 58 virtual ~WebHelperPluginImpl(); |
57 bool initialize(WebViewImpl*, const String& pluginType); | 59 bool initialize(const String& pluginType, const WebDocument& hostDocument, W
ebViewImpl*); |
58 void closeHelperPlugin(); | 60 void closeHelperPlugin(); |
59 | 61 |
60 // WebHelperPlugin methods: | 62 // WebHelperPlugin methods: |
61 virtual void initializeFrame(WebFrameClient*) OVERRIDE; | 63 virtual void initializeFrame(WebFrameClient*) OVERRIDE; |
62 virtual WebPlugin* getPlugin() OVERRIDE; | 64 virtual WebPlugin* getPlugin() OVERRIDE; |
63 | 65 |
64 private: | 66 private: |
65 explicit WebHelperPluginImpl(WebWidgetClient*); | 67 explicit WebHelperPluginImpl(WebWidgetClient*); |
66 bool initializePage(WebKit::WebViewImpl*, const String& pluginType); | 68 bool initializePage(const String& pluginType, const WebDocument& hostDocumen
t); |
67 void destoryPage(); | 69 void destoryPage(); |
68 | 70 |
69 // WebWidget methods: | 71 // WebWidget methods: |
70 virtual void setCompositorSurfaceReady() OVERRIDE; | 72 virtual void setCompositorSurfaceReady() OVERRIDE; |
71 virtual void composite(bool) OVERRIDE; | 73 virtual void composite(bool) OVERRIDE; |
72 virtual void layout() OVERRIDE; | 74 virtual void layout() OVERRIDE; |
73 virtual void setFocus(bool) OVERRIDE; | 75 virtual void setFocus(bool) OVERRIDE; |
74 virtual void close() OVERRIDE; | 76 virtual void close() OVERRIDE; |
75 | 77 |
76 WebWidgetClient* m_widgetClient; | 78 WebWidgetClient* m_widgetClient; |
77 WebViewImpl* m_webView; | 79 WebViewImpl* m_webView; |
78 OwnPtr<WebCore::Page> m_page; | 80 OwnPtr<WebCore::Page> m_page; |
79 OwnPtr<HelperPluginChromeClient> m_chromeClient; | 81 OwnPtr<HelperPluginChromeClient> m_chromeClient; |
80 | 82 |
81 friend class WebHelperPlugin; | 83 friend class WebHelperPlugin; |
82 friend class HelperPluginChromeClient; | 84 friend class HelperPluginChromeClient; |
83 }; | 85 }; |
84 | 86 |
85 } // namespace WebKit | 87 } // namespace WebKit |
86 | 88 |
87 #endif // WebHelperPluginImpl_h | 89 #endif // WebHelperPluginImpl_h |
OLD | NEW |