Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: content/child/npapi/webplugin.h

Issue 23503043: Load NPAPI plugin resources through the browser process directly instead of going through the render (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CHILD_NPAPI_WEBPLUGIN_H_ 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_H_
6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_H_ 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 28 matching lines...) Expand all
39 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, 39 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate,
40 // as well as the information about the HDC for paint operations. 40 // as well as the information about the HDC for paint operations.
41 virtual void SetWindow(gfx::PluginWindowHandle window) = 0; 41 virtual void SetWindow(gfx::PluginWindowHandle window) = 0;
42 42
43 // Whether input events should be sent to the delegate. 43 // Whether input events should be sent to the delegate.
44 virtual void SetAcceptsInputEvents(bool accepts) = 0; 44 virtual void SetAcceptsInputEvents(bool accepts) = 0;
45 45
46 // Called by the plugin delegate to let it know that the window is being 46 // Called by the plugin delegate to let it know that the window is being
47 // destroyed. 47 // destroyed.
48 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; 48 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0;
49 #if defined(OS_WIN) 49
50 // |pump_messages_event| is a event handle which is used in NPP_HandleEvent
51 // calls to pump messages if the plugin enters a modal loop.
52 // |dummy_activation_window} is used to ensure correct keyboard activation.
53 // It needs to be a child of the parent window.
54 virtual void SetWindowlessData(HANDLE pump_messages_event,
55 gfx::NativeViewId dummy_activation_window) = 0;
56 #endif
57 // Cancels a pending request. 50 // Cancels a pending request.
58 virtual void CancelResource(unsigned long id) = 0; 51 virtual void CancelResource(unsigned long id) = 0;
59 virtual void Invalidate() = 0; 52 virtual void Invalidate() = 0;
60 virtual void InvalidateRect(const gfx::Rect& rect) = 0; 53 virtual void InvalidateRect(const gfx::Rect& rect) = 0;
61 54
62 // Returns the NPObject for the browser's window object. Does not 55 // Returns the NPObject for the browser's window object. Does not
63 // take a reference. 56 // take a reference.
64 virtual NPObject* GetWindowScriptNPObject() = 0; 57 virtual NPObject* GetWindowScriptNPObject() = 0;
65 58
66 // Returns the DOM element that loaded the plugin. Does not take a 59 // Returns the DOM element that loaded the plugin. Does not take a
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 95
103 // Called when the WebPluginResourceClient instance is deleted. 96 // Called when the WebPluginResourceClient instance is deleted.
104 virtual void ResourceClientDeleted( 97 virtual void ResourceClientDeleted(
105 WebPluginResourceClient* resource_client) {} 98 WebPluginResourceClient* resource_client) {}
106 99
107 // Defers the loading of the resource identified by resource_id. This is 100 // Defers the loading of the resource identified by resource_id. This is
108 // controlled by the defer parameter. 101 // controlled by the defer parameter.
109 virtual void SetDeferResourceLoading(unsigned long resource_id, 102 virtual void SetDeferResourceLoading(unsigned long resource_id,
110 bool defer) = 0; 103 bool defer) = 0;
111 104
105 // Handles NPN_URLRedirectResponse calls issued by plugins in response to
106 // HTTP URL redirect notifications.
107 virtual void URLRedirectResponse(bool allow, int resource_id) = 0;
108
109 // Returns true if the new url is a secure transition. This is to catch a
110 // plugin src url transitioning from https to http.
111 virtual bool CheckIfRunInsecureContent(const GURL& url) = 0;
112
113 #if defined(OS_WIN)
114 // |pump_messages_event| is a event handle which is used in NPP_HandleEvent
115 // calls to pump messages if the plugin enters a modal loop.
116 // |dummy_activation_window} is used to ensure correct keyboard activation.
117 // It needs to be a child of the parent window.
118 virtual void SetWindowlessData(HANDLE pump_messages_event,
119 gfx::NativeViewId dummy_activation_window) = 0;
120 #endif
121
112 #if defined(OS_MACOSX) 122 #if defined(OS_MACOSX)
113 // Called to inform the WebPlugin that the plugin has gained or lost focus. 123 // Called to inform the WebPlugin that the plugin has gained or lost focus.
114 virtual void FocusChanged(bool focused) {} 124 virtual void FocusChanged(bool focused) {}
115 125
116 // Starts plugin IME. 126 // Starts plugin IME.
117 virtual void StartIme() {} 127 virtual void StartIme() {}
118 128
119 // Returns the accelerated surface abstraction for accelerated plugins. 129 // Returns the accelerated surface abstraction for accelerated plugins.
120 virtual WebPluginAcceleratedSurface* GetAcceleratedSurface( 130 virtual WebPluginAcceleratedSurface* GetAcceleratedSurface(
121 gfx::GpuPreference gpu_preference) = 0; 131 gfx::GpuPreference gpu_preference) = 0;
122 132
123 // Core Animation plugin support. CA plugins always render through 133 // Core Animation plugin support. CA plugins always render through
124 // the compositor. 134 // the compositor.
125 virtual void AcceleratedPluginEnabledRendering() = 0; 135 virtual void AcceleratedPluginEnabledRendering() = 0;
126 virtual void AcceleratedPluginAllocatedIOSurface(int32 width, 136 virtual void AcceleratedPluginAllocatedIOSurface(int32 width,
127 int32 height, 137 int32 height,
128 uint32 surface_id) = 0; 138 uint32 surface_id) = 0;
129 virtual void AcceleratedPluginSwappedIOSurface() = 0; 139 virtual void AcceleratedPluginSwappedIOSurface() = 0;
130 #endif 140 #endif
131
132 // Handles NPN_URLRedirectResponse calls issued by plugins in response to
133 // HTTP URL redirect notifications.
134 virtual void URLRedirectResponse(bool allow, int resource_id) = 0;
135 }; 141 };
136 142
137 } // namespace content 143 } // namespace content
138 144
139 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_H_ 145 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698