| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 5 #ifndef CONTENT_COMMON_PLUGIN_LIST_H_ |
| 6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 6 #define CONTENT_COMMON_PLUGIN_LIST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 17 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "webkit/plugins/webkit_plugins_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "webkit/plugins/webplugininfo.h" | 21 #include "webkit/plugins/webplugininfo.h" |
| 22 | 22 |
| 23 class GURL; | 23 class GURL; |
| 24 | 24 |
| 25 namespace webkit { | 25 namespace content { |
| 26 namespace npapi { | |
| 27 | 26 |
| 28 // The PluginList is responsible for loading our NPAPI based plugins. It does | 27 // The PluginList is responsible for loading our NPAPI based plugins. It does |
| 29 // so in whatever manner is appropriate for the platform. On Windows, it loads | 28 // so in whatever manner is appropriate for the platform. On Windows, it loads |
| 30 // plugins from a known directory by looking for DLLs which start with "NP", | 29 // plugins from a known directory by looking for DLLs which start with "NP", |
| 31 // and checking to see if they are valid NPAPI libraries. On the Mac, it walks | 30 // and checking to see if they are valid NPAPI libraries. On the Mac, it walks |
| 32 // the machine-wide and user plugin directories and loads anything that has | 31 // the machine-wide and user plugin directories and loads anything that has |
| 33 // the correct types. On Linux, it walks the plugin directories as well | 32 // the correct types. On Linux, it walks the plugin directories as well |
| 34 // (e.g. /usr/lib/browser-plugins/). | 33 // (e.g. /usr/lib/browser-plugins/). |
| 35 // This object is thread safe. | 34 // This object is thread safe. |
| 36 class PluginList { | 35 class CONTENT_EXPORT PluginList { |
| 37 public: | 36 public: |
| 38 | 37 |
| 39 // Gets the one instance of the PluginList. | 38 // Gets the one instance of the PluginList. |
| 40 static PluginList* Singleton(); | 39 static PluginList* Singleton(); |
| 41 | 40 |
| 42 // Returns true if we're in debug-plugin-loading mode. This is controlled | 41 // Returns true if we're in debug-plugin-loading mode. This is controlled |
| 43 // by a command line switch. | 42 // by a command line switch. |
| 44 static bool DebugPluginLoading(); | 43 static bool DebugPluginLoading(); |
| 45 | 44 |
| 46 // Returns true if the plugin supports |mime_type|. |mime_type| should be all | 45 // Returns true if the plugin supports |mime_type|. |mime_type| should be all |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // accessed on multiple threads. | 239 // accessed on multiple threads. |
| 241 base::Lock lock_; | 240 base::Lock lock_; |
| 242 | 241 |
| 243 // Flag indicating whether third_party plugins will be searched for | 242 // Flag indicating whether third_party plugins will be searched for |
| 244 // in common places. | 243 // in common places. |
| 245 bool plugins_discovery_disabled_; | 244 bool plugins_discovery_disabled_; |
| 246 | 245 |
| 247 DISALLOW_COPY_AND_ASSIGN(PluginList); | 246 DISALLOW_COPY_AND_ASSIGN(PluginList); |
| 248 }; | 247 }; |
| 249 | 248 |
| 250 } // namespace npapi | 249 } // namespace content |
| 251 } // namespace webkit | |
| 252 | 250 |
| 253 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 251 #endif // CONTENT_COMMON_PLUGIN_LIST_H_ |
| OLD | NEW |