- add sources.
[platform/framework/web/crosswalk.git] / src / content / public / browser / plugin_service_filter.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_
6 #define CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_
7
8 class GURL;
9
10 namespace base {
11 class FilePath;
12 }
13
14 namespace content {
15 struct WebPluginInfo;
16
17 // Callback class to let the client filter the list of all installed plug-ins
18 // and block them from being loaded.
19 // This class is called on the FILE thread.
20 class PluginServiceFilter {
21  public:
22   virtual ~PluginServiceFilter() {}
23
24   // Whether |plugin| is available. The client can return false to hide the
25   // plugin, or return true and optionally change the passed in plugin.
26   virtual bool IsPluginAvailable(int render_process_id,
27                                  int render_view_id,
28                                  const void* context,
29                                  const GURL& url,
30                                  const GURL& policy_url,
31                                  WebPluginInfo* plugin) = 0;
32
33   // Whether the renderer has permission to load available |plugin|.
34   virtual bool CanLoadPlugin(int render_process_id,
35                              const base::FilePath& path) = 0;
36 };
37
38 }  // namespace content
39
40 #endif  // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_FILTER_H_