| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_H_ | |
| 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ui/gfx/native_widget_types.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class FilePath; | |
| 14 } | |
| 15 | |
| 16 namespace WebKit { | |
| 17 class WebCookieJar; | |
| 18 class WebPlugin; | |
| 19 } | |
| 20 | |
| 21 namespace webkit { | |
| 22 namespace npapi { | |
| 23 | |
| 24 class WebPluginDelegate; | |
| 25 struct WebPluginGeometry; | |
| 26 | |
| 27 // Used by the WebPlugin to communicate back to the containing page. | |
| 28 class WebPluginPageDelegate { | |
| 29 public: | |
| 30 // This method is called to create a WebPluginDelegate implementation when a | |
| 31 // new plugin is instanced. See CreateWebPluginDelegateHelper | |
| 32 // for a default WebPluginDelegate implementation. | |
| 33 virtual WebPluginDelegate* CreatePluginDelegate( | |
| 34 const base::FilePath& file_path, | |
| 35 const std::string& mime_type) = 0; | |
| 36 | |
| 37 // Caled to create a replacement plug-in when loading a plug-in failed. | |
| 38 virtual WebKit::WebPlugin* CreatePluginReplacement( | |
| 39 const base::FilePath& file_path) = 0; | |
| 40 | |
| 41 // Called when a windowed plugin is created. | |
| 42 // Lets the view delegate create anything it is using to wrap the plugin. | |
| 43 virtual void CreatedPluginWindow( | |
| 44 gfx::PluginWindowHandle handle) = 0; | |
| 45 | |
| 46 // Called when a windowed plugin is closing. | |
| 47 // Lets the view delegate shut down anything it is using to wrap the plugin. | |
| 48 virtual void WillDestroyPluginWindow( | |
| 49 gfx::PluginWindowHandle handle) = 0; | |
| 50 | |
| 51 // Keeps track of the necessary window move for a plugin window that resulted | |
| 52 // from a scroll operation. That way, all plugin windows can be moved at the | |
| 53 // same time as each other and the page. | |
| 54 virtual void DidMovePlugin( | |
| 55 const WebPluginGeometry& move) = 0; | |
| 56 | |
| 57 // Notifies the parent view that a load has begun. | |
| 58 virtual void DidStartLoadingForPlugin() = 0; | |
| 59 | |
| 60 // Notifies the parent view that all loads are finished. | |
| 61 virtual void DidStopLoadingForPlugin() = 0; | |
| 62 | |
| 63 // The WebCookieJar to use for this plugin. | |
| 64 virtual WebKit::WebCookieJar* GetCookieJar() = 0; | |
| 65 | |
| 66 protected: | |
| 67 virtual ~WebPluginPageDelegate() {} | |
| 68 }; | |
| 69 | |
| 70 } // namespace npapi | |
| 71 } // namespace webkit | |
| 72 | |
| 73 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_H_ | |
| OLD | NEW |