| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 namespace webkit { | 45 namespace webkit { |
| 46 namespace npapi { | 46 namespace npapi { |
| 47 class WebPlugin; | 47 class WebPlugin; |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 // An implementation of WebPluginDelegate that proxies all calls to | 51 // An implementation of WebPluginDelegate that proxies all calls to |
| 52 // the plugin process. | 52 // the plugin process. |
| 53 class WebPluginDelegateProxy | 53 class WebPluginDelegateProxy |
| 54 : public webkit::npapi::WebPluginDelegate, | 54 : public webkit::npapi::WebPluginDelegate, |
| 55 public IPC::Channel::Listener, | 55 public IPC::Listener, |
| 56 public IPC::Message::Sender, | 56 public IPC::Sender, |
| 57 public base::SupportsWeakPtr<WebPluginDelegateProxy> { | 57 public base::SupportsWeakPtr<WebPluginDelegateProxy> { |
| 58 public: | 58 public: |
| 59 WebPluginDelegateProxy(const std::string& mime_type, | 59 WebPluginDelegateProxy(const std::string& mime_type, |
| 60 const base::WeakPtr<RenderViewImpl>& render_view); | 60 const base::WeakPtr<RenderViewImpl>& render_view); |
| 61 | 61 |
| 62 // WebPluginDelegate implementation: | 62 // WebPluginDelegate implementation: |
| 63 virtual void PluginDestroyed() OVERRIDE; | 63 virtual void PluginDestroyed() OVERRIDE; |
| 64 virtual bool Initialize(const GURL& url, | 64 virtual bool Initialize(const GURL& url, |
| 65 const std::vector<std::string>& arg_names, | 65 const std::vector<std::string>& arg_names, |
| 66 const std::vector<std::string>& arg_values, | 66 const std::vector<std::string>& arg_values, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 virtual void SetWindowFocus(bool window_has_focus); | 98 virtual void SetWindowFocus(bool window_has_focus); |
| 99 // Informs the plugin that its container (window/tab) has changed visibility. | 99 // Informs the plugin that its container (window/tab) has changed visibility. |
| 100 virtual void SetContainerVisibility(bool is_visible); | 100 virtual void SetContainerVisibility(bool is_visible); |
| 101 // Informs the plugin that its enclosing window's frame has changed. | 101 // Informs the plugin that its enclosing window's frame has changed. |
| 102 virtual void WindowFrameChanged(gfx::Rect window_frame, gfx::Rect view_frame); | 102 virtual void WindowFrameChanged(gfx::Rect window_frame, gfx::Rect view_frame); |
| 103 // Informs the plugin that plugin IME has completed. | 103 // Informs the plugin that plugin IME has completed. |
| 104 // If |text| is empty, composition was cancelled. | 104 // If |text| is empty, composition was cancelled. |
| 105 virtual void ImeCompositionCompleted(const string16& text, int plugin_id); | 105 virtual void ImeCompositionCompleted(const string16& text, int plugin_id); |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 // IPC::Channel::Listener implementation: | 108 // IPC::Listener implementation: |
| 109 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 109 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 110 virtual void OnChannelError() OVERRIDE; | 110 virtual void OnChannelError() OVERRIDE; |
| 111 | 111 |
| 112 // IPC::Message::Sender implementation: | 112 // IPC::Sender implementation: |
| 113 virtual bool Send(IPC::Message* msg) OVERRIDE; | 113 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 114 | 114 |
| 115 virtual void SendJavaScriptStream(const GURL& url, | 115 virtual void SendJavaScriptStream(const GURL& url, |
| 116 const std::string& result, | 116 const std::string& result, |
| 117 bool success, | 117 bool success, |
| 118 int notify_id) OVERRIDE; | 118 int notify_id) OVERRIDE; |
| 119 | 119 |
| 120 virtual void DidReceiveManualResponse(const GURL& url, | 120 virtual void DidReceiveManualResponse(const GURL& url, |
| 121 const std::string& mime_type, | 121 const std::string& mime_type, |
| 122 const std::string& headers, | 122 const std::string& headers, |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // back-buffer. | 322 // back-buffer. |
| 323 gfx::Rect front_buffer_diff_; | 323 gfx::Rect front_buffer_diff_; |
| 324 | 324 |
| 325 // The url of the main frame hosting the plugin. | 325 // The url of the main frame hosting the plugin. |
| 326 GURL page_url_; | 326 GURL page_url_; |
| 327 | 327 |
| 328 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); | 328 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); |
| 329 }; | 329 }; |
| 330 | 330 |
| 331 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 331 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
| OLD | NEW |