OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "content/common/content_export.h" |
17 #include "ppapi/proxy/broker_dispatcher.h" | 18 #include "ppapi/proxy/broker_dispatcher.h" |
18 #include "ppapi/proxy/proxy_channel.h" | 19 #include "ppapi/proxy/proxy_channel.h" |
19 #include "webkit/plugins/ppapi/plugin_delegate.h" | 20 #include "webkit/plugins/ppapi/plugin_delegate.h" |
20 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
21 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
22 | 23 |
23 class FilePath; | 24 class FilePath; |
24 class PepperPluginDelegateImpl; | 25 class PepperPluginDelegateImpl; |
25 class RenderView; | 26 class RenderView; |
26 | 27 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 // Attempts to create a PPAPI plugin for the given filepath. On success, it | 123 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
123 // will return the newly-created module. | 124 // will return the newly-created module. |
124 // | 125 // |
125 // There are two reasons for failure. The first is that the plugin isn't | 126 // There are two reasons for failure. The first is that the plugin isn't |
126 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | 127 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |
127 // to false and the caller may want to fall back on creating an NPAPI plugin. | 128 // to false and the caller may want to fall back on creating an NPAPI plugin. |
128 // the second is that the plugin failed to initialize. In this case, | 129 // the second is that the plugin failed to initialize. In this case, |
129 // |*pepper_plugin_was_registered| will be set to true and the caller should | 130 // |*pepper_plugin_was_registered| will be set to true and the caller should |
130 // not fall back on any other plugin types. | 131 // not fall back on any other plugin types. |
131 scoped_refptr<webkit::ppapi::PluginModule> CreatePepperPluginModule( | 132 CONTENT_EXPORT scoped_refptr<webkit::ppapi::PluginModule> |
| 133 CreatePepperPluginModule( |
132 const webkit::WebPluginInfo& webplugin_info, | 134 const webkit::WebPluginInfo& webplugin_info, |
133 bool* pepper_plugin_was_registered); | 135 bool* pepper_plugin_was_registered); |
134 | 136 |
135 // Called by RenderView to tell us about painting events, these two functions | 137 // Called by RenderView to tell us about painting events, these two functions |
136 // just correspond to the DidInitiatePaint and DidFlushPaint in R.V.. | 138 // just correspond to the DidInitiatePaint and DidFlushPaint in R.V.. |
137 void ViewInitiatedPaint(); | 139 void ViewInitiatedPaint(); |
138 void ViewFlushedPaint(); | 140 void ViewFlushedPaint(); |
139 | 141 |
140 // Called by RenderView to implement the corresponding function in its base | 142 // Called by RenderView to implement the corresponding function in its base |
141 // class RenderWidget (see that for more). | 143 // class RenderWidget (see that for more). |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 virtual void SetContentRestriction(int restrictions) OVERRIDE; | 298 virtual void SetContentRestriction(int restrictions) OVERRIDE; |
297 virtual void SaveURLAs(const GURL& url) OVERRIDE; | 299 virtual void SaveURLAs(const GURL& url) OVERRIDE; |
298 virtual content::P2PSocketDispatcher* GetP2PSocketDispatcher() OVERRIDE; | 300 virtual content::P2PSocketDispatcher* GetP2PSocketDispatcher() OVERRIDE; |
299 virtual webkit_glue::P2PTransport* CreateP2PTransport() OVERRIDE; | 301 virtual webkit_glue::P2PTransport* CreateP2PTransport() OVERRIDE; |
300 virtual double GetLocalTimeZoneOffset(base::Time t) OVERRIDE; | 302 virtual double GetLocalTimeZoneOffset(base::Time t) OVERRIDE; |
301 virtual std::string GetFlashCommandLineArgs() OVERRIDE; | 303 virtual std::string GetFlashCommandLineArgs() OVERRIDE; |
302 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) | 304 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) |
303 OVERRIDE; | 305 OVERRIDE; |
304 virtual ::ppapi::Preferences GetPreferences() OVERRIDE; | 306 virtual ::ppapi::Preferences GetPreferences() OVERRIDE; |
305 | 307 |
306 int GetRoutingId() const; | 308 CONTENT_EXPORT int GetRoutingId() const; |
307 | 309 |
308 private: | 310 private: |
309 void PublishInitialPolicy( | 311 void PublishInitialPolicy( |
310 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 312 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
311 const std::string& policy); | 313 const std::string& policy); |
312 | 314 |
313 // Asynchronously attempts to create a PPAPI broker for the given plugin. | 315 // Asynchronously attempts to create a PPAPI broker for the given plugin. |
314 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( | 316 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( |
315 webkit::ppapi::PluginModule* plugin_module); | 317 webkit::ppapi::PluginModule* plugin_module); |
316 | 318 |
(...skipping 24 matching lines...) Expand all Loading... |
341 bool is_pepper_plugin_focused_; | 343 bool is_pepper_plugin_focused_; |
342 | 344 |
343 // Set of instances to receive a notification when the enterprise policy has | 345 // Set of instances to receive a notification when the enterprise policy has |
344 // been updated. | 346 // been updated. |
345 std::set<webkit::ppapi::PluginInstance*> subscribed_to_policy_updates_; | 347 std::set<webkit::ppapi::PluginInstance*> subscribed_to_policy_updates_; |
346 | 348 |
347 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 349 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
348 }; | 350 }; |
349 | 351 |
350 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 352 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |