| 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 COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 5 #ifndef COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/sequenced_task_runner_helpers.h" | 12 #include "base/sequenced_task_runner_helpers.h" |
| 13 #include "content/public/renderer/render_view_observer.h" | 13 #include "content/public/renderer/render_view_observer.h" |
| 14 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 14 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 15 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
| 16 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 16 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 17 #include "third_party/WebKit/public/web/WebFrameClient.h" | 17 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 18 #include "third_party/WebKit/public/web/WebKit.h" | 18 #include "third_party/WebKit/public/web/WebKit.h" |
| 19 #include "third_party/WebKit/public/web/WebPlugin.h" | 19 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 20 #include "third_party/WebKit/public/web/WebViewClient.h" | 20 #include "third_party/WebKit/public/web/WebViewClient.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 class WebFrameWidget; | |
| 24 class WebMouseEvent; | 23 class WebMouseEvent; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class RenderView; | 27 class RenderView; |
| 29 struct WebPreferences; | 28 struct WebPreferences; |
| 30 } | 29 } |
| 31 | 30 |
| 32 namespace gfx { | |
| 33 class Size; | |
| 34 } | |
| 35 | |
| 36 // This class implements the WebPlugin interface by forwarding drawing and | 31 // This class implements the WebPlugin interface by forwarding drawing and |
| 37 // handling input events to a WebView. | 32 // handling input events to a WebView. |
| 38 // It can be used as a placeholder for an actual plugin, using HTML for the UI. | 33 // It can be used as a placeholder for an actual plugin, using HTML for the UI. |
| 39 // To show HTML data inside the WebViewPlugin, | 34 // To show HTML data inside the WebViewPlugin, |
| 40 // call web_view->mainFrame()->loadHTMLString() with the HTML data and a fake | 35 // call web_view->mainFrame()->loadHTMLString() with the HTML data and a fake |
| 41 // chrome:// URL as origin. | 36 // chrome:// URL as origin. |
| 42 | 37 |
| 43 class WebViewPlugin : public blink::WebPlugin, | 38 class WebViewPlugin : public blink::WebPlugin, |
| 44 public blink::WebViewClient, | 39 public blink::WebViewClient, |
| 45 public content::RenderViewObserver { | 40 public content::RenderViewObserver { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 private: | 166 private: |
| 172 WebViewPlugin* plugin_; | 167 WebViewPlugin* plugin_; |
| 173 }; | 168 }; |
| 174 PluginWebFrameClient web_frame_client_; | 169 PluginWebFrameClient web_frame_client_; |
| 175 | 170 |
| 176 // Should be invalidated when destroy() is called. | 171 // Should be invalidated when destroy() is called. |
| 177 base::WeakPtrFactory<WebViewPlugin> weak_factory_; | 172 base::WeakPtrFactory<WebViewPlugin> weak_factory_; |
| 178 }; | 173 }; |
| 179 | 174 |
| 180 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 175 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| OLD | NEW |