OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | |
13 | 14 |
14 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
15 #include "base/file_path.h" | 16 #include "base/file_path.h" |
16 #include "base/hash_tables.h" | 17 #include "base/hash_tables.h" |
17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
18 #include "base/memory/singleton.h" | 19 #include "base/memory/singleton.h" |
19 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
20 #include "base/synchronization/waitable_event_watcher.h" | 21 #include "base/synchronization/waitable_event_watcher.h" |
21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
22 #include "content/browser/plugin_process_host.h" | 23 #include "content/browser/plugin_process_host.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 | 94 |
94 // Gets the plugin in the list of plugins that matches the given url and mime | 95 // Gets the plugin in the list of plugins that matches the given url and mime |
95 // type. Must be called on the FILE thread. | 96 // type. Must be called on the FILE thread. |
96 bool GetPluginInfo(int render_process_id, | 97 bool GetPluginInfo(int render_process_id, |
97 int render_view_id, | 98 int render_view_id, |
98 const GURL& url, | 99 const GURL& url, |
99 const std::string& mime_type, | 100 const std::string& mime_type, |
100 webkit::WebPluginInfo* info, | 101 webkit::WebPluginInfo* info, |
101 std::string* actual_mime_type); | 102 std::string* actual_mime_type); |
102 | 103 |
103 // Safe to be called from any thread. | 104 // Safe to be called from any thread. If |plugin| has an empty |url| field, |
jam
2011/08/16 00:45:54
nit: this comment belongs above OverriddenPlugin::
| |
105 // then the override applies to all urls in that tab. | |
104 void OverridePluginForTab(const OverriddenPlugin& plugin); | 106 void OverridePluginForTab(const OverriddenPlugin& plugin); |
105 | 107 |
106 // Restricts the given plugin to the the scheme and host of the given url. | 108 // Restricts the given plugin to the the scheme and host of the given url. |
107 // Call with an empty url to reset this. | 109 // Call with an empty url to reset this. |
108 // Can be called on any thread. | 110 // Can be called on any thread. |
109 void RestrictPluginToUrl(const FilePath& plugin_path, const GURL& url); | 111 void RestrictPluginToUrl(const FilePath& plugin_path, const GURL& url); |
110 | 112 |
111 // Returns true if the given plugin is allowed to be used by a page with | 113 // Returns true if the given plugin is allowed to be used by a page with |
112 // the given URL. | 114 // the given URL. |
113 // Can be called on any thread. | 115 // Can be called on any thread. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 190 |
189 std::vector<OverriddenPlugin> overridden_plugins_; | 191 std::vector<OverriddenPlugin> overridden_plugins_; |
190 base::Lock overridden_plugins_lock_; | 192 base::Lock overridden_plugins_lock_; |
191 | 193 |
192 DISALLOW_COPY_AND_ASSIGN(PluginService); | 194 DISALLOW_COPY_AND_ASSIGN(PluginService); |
193 }; | 195 }; |
194 | 196 |
195 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); | 197 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); |
196 | 198 |
197 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 199 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
OLD | NEW |