| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_BLOCKED_PLUGIN_H_ | 5 #ifndef CHROME_RENDERER_BLOCKED_PLUGIN_H_ |
| 6 #define CHROME_RENDERER_BLOCKED_PLUGIN_H_ | 6 #define CHROME_RENDERER_BLOCKED_PLUGIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/common/notification_observer.h" | 9 #include "chrome/common/notification_observer.h" |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| 11 #include "chrome/renderer/custom_menu_listener.h" | 11 #include "chrome/renderer/custom_menu_listener.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
| 13 #include "webkit/glue/cpp_bound_class.h" | 13 #include "webkit/glue/cpp_bound_class.h" |
| 14 #include "webkit/plugins/npapi/webview_plugin.h" | 14 #include "webkit/glue/plugins/webview_plugin.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class PluginGroup; |
| 17 class RenderView; | 18 class RenderView; |
| 18 | 19 |
| 19 | |
| 20 namespace webkit { | |
| 21 namespace npapi { | |
| 22 class PluginGroup; | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 class BlockedPlugin : public CppBoundClass, | 20 class BlockedPlugin : public CppBoundClass, |
| 27 public webkit::npapi::WebViewPlugin::Delegate, | 21 public WebViewPlugin::Delegate, |
| 28 public NotificationObserver, | 22 public NotificationObserver, |
| 29 public CustomMenuListener { | 23 public CustomMenuListener { |
| 30 public: | 24 public: |
| 31 BlockedPlugin(RenderView* render_view, | 25 BlockedPlugin(RenderView* render_view, |
| 32 WebKit::WebFrame* frame, | 26 WebKit::WebFrame* frame, |
| 33 const webkit::npapi::PluginGroup& info, | 27 const PluginGroup& info, |
| 34 const WebKit::WebPluginParams& params, | 28 const WebKit::WebPluginParams& params, |
| 35 const WebPreferences& settings, | 29 const WebPreferences& settings, |
| 36 int template_id, | 30 int template_id, |
| 37 const string16& message); | 31 const string16& message); |
| 38 | 32 |
| 39 webkit::npapi::WebViewPlugin* plugin() { return plugin_; } | 33 WebViewPlugin* plugin() { return plugin_; } |
| 40 | 34 |
| 41 // WebViewPlugin::Delegate methods: | 35 // WebViewPlugin::Delegate methods: |
| 42 virtual void BindWebFrame(WebKit::WebFrame* frame); | 36 virtual void BindWebFrame(WebKit::WebFrame* frame); |
| 43 virtual void WillDestroyPlugin(); | 37 virtual void WillDestroyPlugin(); |
| 44 virtual void ShowContextMenu(const WebKit::WebMouseEvent&); | 38 virtual void ShowContextMenu(const WebKit::WebMouseEvent&); |
| 45 | 39 |
| 46 // NotificationObserver methods: | 40 // NotificationObserver methods: |
| 47 virtual void Observe(NotificationType type, | 41 virtual void Observe(NotificationType type, |
| 48 const NotificationSource& source, | 42 const NotificationSource& source, |
| 49 const NotificationDetails& details); | 43 const NotificationDetails& details); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 | 55 |
| 62 // Load the blocked plugin. | 56 // Load the blocked plugin. |
| 63 void LoadPlugin(); | 57 void LoadPlugin(); |
| 64 | 58 |
| 65 // Hide the blocked plugin. | 59 // Hide the blocked plugin. |
| 66 void HidePlugin(); | 60 void HidePlugin(); |
| 67 | 61 |
| 68 RenderView* render_view_; | 62 RenderView* render_view_; |
| 69 WebKit::WebFrame* frame_; | 63 WebKit::WebFrame* frame_; |
| 70 WebKit::WebPluginParams plugin_params_; | 64 WebKit::WebPluginParams plugin_params_; |
| 71 webkit::npapi::WebViewPlugin* plugin_; | 65 WebViewPlugin* plugin_; |
| 72 // The name of the plugin that was blocked. | 66 // The name of the plugin that was blocked. |
| 73 string16 name_; | 67 string16 name_; |
| 74 | 68 |
| 75 NotificationRegistrar registrar_; | 69 NotificationRegistrar registrar_; |
| 76 }; | 70 }; |
| 77 | 71 |
| 78 #endif // CHROME_RENDERER_BLOCKED_PLUGIN_H_ | 72 #endif // CHROME_RENDERER_BLOCKED_PLUGIN_H_ |
| OLD | NEW |