| 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_FILTER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class FilePath; | 13 class FilePath; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace url { |
| 17 class Origin; |
| 18 } |
| 19 |
| 16 namespace content { | 20 namespace content { |
| 17 struct WebPluginInfo; | 21 struct WebPluginInfo; |
| 18 | 22 |
| 19 // Callback class to let the client filter the list of all installed plugins | 23 // Callback class to let the client filter the list of all installed plugins |
| 20 // and block them from being loaded. | 24 // and block them from being loaded. |
| 21 // This class is called on the FILE thread. | 25 // This class is called on the FILE thread. |
| 22 class PluginServiceFilter { | 26 class PluginServiceFilter { |
| 23 public: | 27 public: |
| 24 virtual ~PluginServiceFilter() {} | 28 virtual ~PluginServiceFilter() {} |
| 25 | 29 |
| 26 // Whether |plugin| is available. The client can return false to hide the | 30 // Whether |plugin| is available. The client can return false to hide the |
| 27 // plugin, or return true and optionally change the passed in plugin. | 31 // plugin, or return true and optionally change the passed in plugin. |
| 28 virtual bool IsPluginAvailable(int render_process_id, | 32 virtual bool IsPluginAvailable(int render_process_id, |
| 29 int render_frame_id, | 33 int render_frame_id, |
| 30 const void* context, | 34 const void* context, |
| 31 const GURL& url, | 35 const GURL& url, |
| 32 const GURL& policy_url, | 36 const url::Origin& main_frame_origin, |
| 33 WebPluginInfo* plugin) = 0; | 37 WebPluginInfo* plugin) = 0; |
| 34 | 38 |
| 35 // Whether the renderer has permission to load available |plugin|. | 39 // Whether the renderer has permission to load available |plugin|. |
| 36 virtual bool CanLoadPlugin(int render_process_id, | 40 virtual bool CanLoadPlugin(int render_process_id, |
| 37 const base::FilePath& path) = 0; | 41 const base::FilePath& path) = 0; |
| 38 }; | 42 }; |
| 39 | 43 |
| 40 } // namespace content | 44 } // namespace content |
| 41 | 45 |
| 42 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_ | 46 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_ |
| OLD | NEW |