| OLD | NEW |
| 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_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class FilePath; | 18 class FilePath; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace webkit { | 21 namespace webkit { |
| 22 struct WebPluginInfo; | 22 struct WebPluginInfo; |
| 23 namespace npapi { | |
| 24 class PluginList; | |
| 25 } | |
| 26 } | 23 } |
| 27 | 24 |
| 28 namespace content { | 25 namespace content { |
| 29 | 26 |
| 30 class BrowserContext; | 27 class BrowserContext; |
| 31 class PluginProcessHost; | 28 class PluginProcessHost; |
| 32 class PluginServiceFilter; | 29 class PluginServiceFilter; |
| 33 class ResourceContext; | 30 class ResourceContext; |
| 34 struct PepperPluginInfo; | 31 struct PepperPluginInfo; |
| 35 | 32 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 virtual void SetFilter(PluginServiceFilter* filter) = 0; | 108 virtual void SetFilter(PluginServiceFilter* filter) = 0; |
| 112 virtual PluginServiceFilter* GetFilter() = 0; | 109 virtual PluginServiceFilter* GetFilter() = 0; |
| 113 | 110 |
| 114 // If the plugin with the given path is running, cleanly shuts it down. | 111 // If the plugin with the given path is running, cleanly shuts it down. |
| 115 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) = 0; | 112 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) = 0; |
| 116 | 113 |
| 117 // Used to monitor plug-in stability. An unstable plug-in is one that has | 114 // Used to monitor plug-in stability. An unstable plug-in is one that has |
| 118 // crashed more than a set number of times in a set time period. | 115 // crashed more than a set number of times in a set time period. |
| 119 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) = 0; | 116 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) = 0; |
| 120 | 117 |
| 121 // The following functions are wrappers around webkit::npapi::PluginList. | 118 // Cause the plugin list to refresh next time they are accessed, regardless |
| 122 // These must be used instead of those in order to ensure that we have a | 119 // of whether they are already loaded. |
| 123 // single global list in the component build and so that we don't | |
| 124 // accidentally load plugins in the wrong process or thread. Refer to | |
| 125 // PluginList for further documentation of these functions. | |
| 126 virtual void RefreshPlugins() = 0; | 120 virtual void RefreshPlugins() = 0; |
| 121 |
| 122 // Add/Remove an extra plugin to load when we actually do the loading. Must |
| 123 // be called before the plugins have been loaded. |
| 127 virtual void AddExtraPluginPath(const base::FilePath& path) = 0; | 124 virtual void AddExtraPluginPath(const base::FilePath& path) = 0; |
| 125 virtual void RemoveExtraPluginPath(const base::FilePath& path) = 0; |
| 126 |
| 127 // Same as above, but specifies a directory in which to search for plugins. |
| 128 virtual void AddExtraPluginDir(const base::FilePath& path) = 0; | 128 virtual void AddExtraPluginDir(const base::FilePath& path) = 0; |
| 129 virtual void RemoveExtraPluginPath(const base::FilePath& path) = 0; | 129 |
| 130 virtual void UnregisterInternalPlugin(const base::FilePath& path) = 0; | 130 // Register an internal plugin with the specified plugin information. |
| 131 // An internal plugin must be registered before it can |
| 132 // be loaded using PluginList::LoadPlugin(). |
| 133 // If |add_at_beginning| is true the plugin will be added earlier in |
| 134 // the list so that it can override the MIME types of older registrations. |
| 131 virtual void RegisterInternalPlugin(const webkit::WebPluginInfo& info, | 135 virtual void RegisterInternalPlugin(const webkit::WebPluginInfo& info, |
| 132 bool add_at_beginning) = 0; | 136 bool add_at_beginning) = 0; |
| 137 |
| 138 // Removes a specified internal plugin from the list. The search will match |
| 139 // on the path from the version info previously registered. |
| 140 virtual void UnregisterInternalPlugin(const base::FilePath& path) = 0; |
| 141 |
| 142 // Gets a list of all the registered internal plugins. |
| 133 virtual void GetInternalPlugins( | 143 virtual void GetInternalPlugins( |
| 134 std::vector<webkit::WebPluginInfo>* plugins) = 0; | 144 std::vector<webkit::WebPluginInfo>* plugins) = 0; |
| 135 | 145 |
| 136 virtual void SetPluginListForTesting( | 146 // This is equivalent to specifying kDisablePluginsDiscovery, but is useful |
| 137 webkit::npapi::PluginList* plugin_list) = 0; | 147 // for unittests. |
| 148 virtual void DisablePluginsDiscoveryForTesting() = 0; |
| 138 | 149 |
| 139 #if defined(OS_MACOSX) | 150 #if defined(OS_MACOSX) |
| 140 // Called when the application is made active so that modal plugin windows can | 151 // Called when the application is made active so that modal plugin windows can |
| 141 // be made forward too. | 152 // be made forward too. |
| 142 virtual void AppActivated() = 0; | 153 virtual void AppActivated() = 0; |
| 143 #endif | 154 #endif |
| 144 }; | 155 }; |
| 145 | 156 |
| 146 } // namespace content | 157 } // namespace content |
| 147 | 158 |
| 148 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ | 159 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ |
| OLD | NEW |