OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 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_GLUE_WEBPLUGIN_PAGE_DELEGATE_ | |
6 #define WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_ | |
7 | |
8 #include "gfx/native_widget_types.h" | |
9 | |
10 class FilePath; | |
11 class GURL; | |
12 | |
13 namespace WebKit { | |
14 class WebCookieJar; | |
15 } | |
16 | |
17 namespace webkit_glue { | |
18 | |
19 class WebPluginDelegate; | |
20 struct WebPluginGeometry; | |
21 | |
22 // Used by the WebPlugin to communicate back to the containing page. | |
23 class WebPluginPageDelegate { | |
24 public: | |
25 // This method is called to create a WebPluginDelegate implementation when a | |
26 // new plugin is instanced. See webkit_glue::CreateWebPluginDelegateHelper | |
27 // for a default WebPluginDelegate implementation. | |
28 virtual WebPluginDelegate* CreatePluginDelegate( | |
29 const FilePath& file_path, | |
30 const std::string& mime_type) = 0; | |
31 | |
32 // Called when a windowed plugin is created. | |
33 // Lets the view delegate create anything it is using to wrap the plugin. | |
34 virtual void CreatedPluginWindow( | |
35 gfx::PluginWindowHandle handle) = 0; | |
36 | |
37 // Called when a windowed plugin is closing. | |
38 // Lets the view delegate shut down anything it is using to wrap the plugin. | |
39 virtual void WillDestroyPluginWindow( | |
40 gfx::PluginWindowHandle handle) = 0; | |
41 | |
42 // Keeps track of the necessary window move for a plugin window that resulted | |
43 // from a scroll operation. That way, all plugin windows can be moved at the | |
44 // same time as each other and the page. | |
45 virtual void DidMovePlugin( | |
46 const WebPluginGeometry& move) = 0; | |
47 | |
48 // Notifies the parent view that a load has begun. | |
49 virtual void DidStartLoadingForPlugin() = 0; | |
50 | |
51 // Notifies the parent view that all loads are finished. | |
52 virtual void DidStopLoadingForPlugin() = 0; | |
53 | |
54 // Asks the browser to show a modal HTML dialog. The dialog is passed the | |
55 // given arguments as a JSON string, and returns its result as a JSON string | |
56 // through json_retval. | |
57 virtual void ShowModalHTMLDialogForPlugin( | |
58 const GURL& url, | |
59 const gfx::Size& size, | |
60 const std::string& json_arguments, | |
61 std::string* json_retval) = 0; | |
62 | |
63 // The WebCookieJar to use for this plugin. | |
64 virtual WebKit::WebCookieJar* GetCookieJar() = 0; | |
65 }; | |
66 | |
67 } // namespace webkit_glue | |
68 | |
69 #endif // WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_H_ | |
OLD | NEW |