plugin_service_filter.h revision ca12bfac764ba476d6cd062bf1dde12cc64c3f40
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 8class GURL; 9 10namespace base { 11class FilePath; 12} 13 14namespace content { 15struct 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. 20class 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_ 41