OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_PLUGIN_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_PLUGIN_SERVICE_H_ |
9 #define CHROME_BROWSER_PLUGIN_SERVICE_H_ | 9 #define CHROME_BROWSER_PLUGIN_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 23 matching lines...) Expand all Loading... |
34 #endif | 34 #endif |
35 | 35 |
36 namespace IPC { | 36 namespace IPC { |
37 class Message; | 37 class Message; |
38 } | 38 } |
39 | 39 |
40 class MessageLoop; | 40 class MessageLoop; |
41 class Profile; | 41 class Profile; |
42 class ResourceDispatcherHost; | 42 class ResourceDispatcherHost; |
43 class URLRequestContext; | 43 class URLRequestContext; |
| 44 |
| 45 |
| 46 namespace webkit { |
| 47 namespace npapi { |
44 struct WebPluginInfo; | 48 struct WebPluginInfo; |
| 49 } |
| 50 } |
45 | 51 |
46 // This must be created on the main thread but it's only called on the IO/file | 52 // This must be created on the main thread but it's only called on the IO/file |
47 // thread. | 53 // thread. |
48 class PluginService | 54 class PluginService |
49 : public base::WaitableEventWatcher::Delegate, | 55 : public base::WaitableEventWatcher::Delegate, |
50 public NotificationObserver { | 56 public NotificationObserver { |
51 public: | 57 public: |
52 // Initializes the global instance; should be called on startup from the main | 58 // Initializes the global instance; should be called on startup from the main |
53 // thread. | 59 // thread. |
54 static void InitGlobalInstance(Profile* profile); | 60 static void InitGlobalInstance(Profile* profile); |
(...skipping 28 matching lines...) Expand all Loading... |
83 // a new plugin process if necessary. This must be called on the IO thread | 89 // a new plugin process if necessary. This must be called on the IO thread |
84 // or else a deadlock can occur. | 90 // or else a deadlock can occur. |
85 void OpenChannelToPlugin(const GURL& url, | 91 void OpenChannelToPlugin(const GURL& url, |
86 const std::string& mime_type, | 92 const std::string& mime_type, |
87 PluginProcessHost::Client* client); | 93 PluginProcessHost::Client* client); |
88 | 94 |
89 // Gets the first allowed plugin in the list of plugins that matches | 95 // Gets the first allowed plugin in the list of plugins that matches |
90 // the given url and mime type. Must be called on the FILE thread. | 96 // the given url and mime type. Must be called on the FILE thread. |
91 bool GetFirstAllowedPluginInfo(const GURL& url, | 97 bool GetFirstAllowedPluginInfo(const GURL& url, |
92 const std::string& mime_type, | 98 const std::string& mime_type, |
93 WebPluginInfo* info, | 99 webkit::npapi::WebPluginInfo* info, |
94 std::string* actual_mime_type); | 100 std::string* actual_mime_type); |
95 | 101 |
96 // Returns true if the given plugin is allowed to be used by a page with | 102 // Returns true if the given plugin is allowed to be used by a page with |
97 // the given URL. | 103 // the given URL. |
98 bool PrivatePluginAllowedForURL(const FilePath& plugin_path, const GURL& url); | 104 bool PrivatePluginAllowedForURL(const FilePath& plugin_path, const GURL& url); |
99 | 105 |
100 // The UI thread's message loop | 106 // The UI thread's message loop |
101 MessageLoop* main_message_loop() { return main_message_loop_; } | 107 MessageLoop* main_message_loop() { return main_message_loop_; } |
102 | 108 |
103 ResourceDispatcherHost* resource_dispatcher_host() const { | 109 ResourceDispatcherHost* resource_dispatcher_host() const { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 180 |
175 // Set to true if chrome plugins are enabled. Defaults to true. | 181 // Set to true if chrome plugins are enabled. Defaults to true. |
176 static bool enable_chrome_plugins_; | 182 static bool enable_chrome_plugins_; |
177 | 183 |
178 DISALLOW_COPY_AND_ASSIGN(PluginService); | 184 DISALLOW_COPY_AND_ASSIGN(PluginService); |
179 }; | 185 }; |
180 | 186 |
181 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); | 187 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); |
182 | 188 |
183 #endif // CHROME_BROWSER_PLUGIN_SERVICE_H_ | 189 #endif // CHROME_BROWSER_PLUGIN_SERVICE_H_ |
OLD | NEW |