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 // This class responds to requests from renderers for the list of plugins, and | 5 // This class responds to requests from renderers for the list of plugins, and |
6 // also a proxy object for plugin instances. | 6 // also a proxy object for plugin instances. |
7 | 7 |
8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Returns the PluginServiceImpl singleton. | 69 // Returns the PluginServiceImpl singleton. |
70 static PluginServiceImpl* GetInstance(); | 70 static PluginServiceImpl* GetInstance(); |
71 | 71 |
72 // PluginService implementation: | 72 // PluginService implementation: |
73 virtual void Init() OVERRIDE; | 73 virtual void Init() OVERRIDE; |
74 virtual void StartWatchingPlugins() OVERRIDE; | 74 virtual void StartWatchingPlugins() OVERRIDE; |
75 virtual bool GetPluginInfoArray( | 75 virtual bool GetPluginInfoArray( |
76 const GURL& url, | 76 const GURL& url, |
77 const std::string& mime_type, | 77 const std::string& mime_type, |
78 bool allow_wildcard, | 78 bool allow_wildcard, |
79 std::vector<webkit::WebPluginInfo>* info, | 79 std::vector<WebPluginInfo>* info, |
80 std::vector<std::string>* actual_mime_types) OVERRIDE; | 80 std::vector<std::string>* actual_mime_types) OVERRIDE; |
81 virtual bool GetPluginInfo(int render_process_id, | 81 virtual bool GetPluginInfo(int render_process_id, |
82 int render_view_id, | 82 int render_view_id, |
83 ResourceContext* context, | 83 ResourceContext* context, |
84 const GURL& url, | 84 const GURL& url, |
85 const GURL& page_url, | 85 const GURL& page_url, |
86 const std::string& mime_type, | 86 const std::string& mime_type, |
87 bool allow_wildcard, | 87 bool allow_wildcard, |
88 bool* is_stale, | 88 bool* is_stale, |
89 webkit::WebPluginInfo* info, | 89 WebPluginInfo* info, |
90 std::string* actual_mime_type) OVERRIDE; | 90 std::string* actual_mime_type) OVERRIDE; |
91 virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, | 91 virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, |
92 webkit::WebPluginInfo* info) OVERRIDE; | 92 WebPluginInfo* info) OVERRIDE; |
93 virtual string16 GetPluginDisplayNameByPath( | 93 virtual string16 GetPluginDisplayNameByPath( |
94 const base::FilePath& path) OVERRIDE; | 94 const base::FilePath& path) OVERRIDE; |
95 virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; | 95 virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; |
96 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( | 96 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( |
97 const base::FilePath& plugin_path) OVERRIDE; | 97 const base::FilePath& plugin_path) OVERRIDE; |
98 virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; | 98 virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; |
99 virtual PluginServiceFilter* GetFilter() OVERRIDE; | 99 virtual PluginServiceFilter* GetFilter() OVERRIDE; |
100 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; | 100 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; |
101 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; | 101 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; |
102 virtual void RefreshPlugins() OVERRIDE; | 102 virtual void RefreshPlugins() OVERRIDE; |
103 virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; | 103 virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; |
104 virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; | 104 virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; |
105 virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; | 105 virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; |
106 virtual void RegisterInternalPlugin( | 106 virtual void RegisterInternalPlugin( |
107 const webkit::WebPluginInfo& info, bool add_at_beginning) OVERRIDE; | 107 const WebPluginInfo& info, bool add_at_beginning) OVERRIDE; |
108 virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; | 108 virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; |
109 virtual void GetInternalPlugins( | 109 virtual void GetInternalPlugins( |
110 std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; | 110 std::vector<WebPluginInfo>* plugins) OVERRIDE; |
111 virtual bool NPAPIPluginsSupported() OVERRIDE; | 111 virtual bool NPAPIPluginsSupported() OVERRIDE; |
112 virtual void DisablePluginsDiscoveryForTesting() OVERRIDE; | 112 virtual void DisablePluginsDiscoveryForTesting() OVERRIDE; |
113 #if defined(OS_MACOSX) | 113 #if defined(OS_MACOSX) |
114 virtual void AppActivated() OVERRIDE; | 114 virtual void AppActivated() OVERRIDE; |
115 #elif defined(OS_WIN) | 115 #elif defined(OS_WIN) |
116 virtual bool GetPluginInfoFromWindow(HWND window, | 116 virtual bool GetPluginInfoFromWindow(HWND window, |
117 base::string16* plugin_name, | 117 base::string16* plugin_name, |
118 base::string16* plugin_version) OVERRIDE; | 118 base::string16* plugin_version) OVERRIDE; |
119 | 119 |
120 // Returns true iff the given HWND is a plugin. | 120 // Returns true iff the given HWND is a plugin. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void GetPluginsInternal(base::MessageLoopProxy* target_loop, | 184 void GetPluginsInternal(base::MessageLoopProxy* target_loop, |
185 const GetPluginsCallback& callback); | 185 const GetPluginsCallback& callback); |
186 | 186 |
187 // Binding directly to GetAllowedPluginForOpenChannelToPlugin() isn't possible | 187 // Binding directly to GetAllowedPluginForOpenChannelToPlugin() isn't possible |
188 // because more arity is needed <http://crbug.com/98542>. This just forwards. | 188 // because more arity is needed <http://crbug.com/98542>. This just forwards. |
189 void ForwardGetAllowedPluginForOpenChannelToPlugin( | 189 void ForwardGetAllowedPluginForOpenChannelToPlugin( |
190 const PluginServiceFilterParams& params, | 190 const PluginServiceFilterParams& params, |
191 const GURL& url, | 191 const GURL& url, |
192 const std::string& mime_type, | 192 const std::string& mime_type, |
193 PluginProcessHost::Client* client, | 193 PluginProcessHost::Client* client, |
194 const std::vector<webkit::WebPluginInfo>&); | 194 const std::vector<WebPluginInfo>&); |
195 // Helper so we can do the plugin lookup on the FILE thread. | 195 // Helper so we can do the plugin lookup on the FILE thread. |
196 void GetAllowedPluginForOpenChannelToPlugin( | 196 void GetAllowedPluginForOpenChannelToPlugin( |
197 int render_process_id, | 197 int render_process_id, |
198 int render_view_id, | 198 int render_view_id, |
199 const GURL& url, | 199 const GURL& url, |
200 const GURL& page_url, | 200 const GURL& page_url, |
201 const std::string& mime_type, | 201 const std::string& mime_type, |
202 PluginProcessHost::Client* client, | 202 PluginProcessHost::Client* client, |
203 ResourceContext* resource_context); | 203 ResourceContext* resource_context); |
204 | 204 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 // Used to detect if a given plug-in is crashing over and over. | 245 // Used to detect if a given plug-in is crashing over and over. |
246 std::map<base::FilePath, std::vector<base::Time> > crash_times_; | 246 std::map<base::FilePath, std::vector<base::Time> > crash_times_; |
247 | 247 |
248 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 248 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
249 }; | 249 }; |
250 | 250 |
251 } // namespace content | 251 } // namespace content |
252 | 252 |
253 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 253 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |