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