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 CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ | 5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ |
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ | 6 #define CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // language tag, i.e. en-US). If found, sets |installer| to the | 44 // language tag, i.e. en-US). If found, sets |installer| to the |
45 // corresponding PluginInstaller and |plugin_metadata| to a copy of the | 45 // corresponding PluginInstaller and |plugin_metadata| to a copy of the |
46 // corresponding PluginMetadata. | 46 // corresponding PluginMetadata. |
47 bool FindPlugin(const std::string& mime_type, | 47 bool FindPlugin(const std::string& mime_type, |
48 const std::string& language, | 48 const std::string& language, |
49 PluginInstaller** installer, | 49 PluginInstaller** installer, |
50 scoped_ptr<PluginMetadata>* plugin_metadata); | 50 scoped_ptr<PluginMetadata>* plugin_metadata); |
51 | 51 |
52 // Finds the plug-in with the given identifier. If found, sets |installer| | 52 // Finds the plug-in with the given identifier. If found, sets |installer| |
53 // to the corresponding PluginInstaller and |plugin_metadata| to a copy | 53 // to the corresponding PluginInstaller and |plugin_metadata| to a copy |
54 // of the corresponding PluginMetadata. | 54 // of the corresponding PluginMetadata. |installer| may be NULL. |
55 bool FindPluginWithIdentifier(const std::string& identifier, | 55 bool FindPluginWithIdentifier(const std::string& identifier, |
56 PluginInstaller** installer, | 56 PluginInstaller** installer, |
57 scoped_ptr<PluginMetadata>* plugin_metadata); | 57 scoped_ptr<PluginMetadata>* plugin_metadata); |
58 #endif | 58 #endif |
59 | 59 |
60 // Returns the plug-in name with the given identifier. | 60 // Returns the plug-in name with the given identifier. |
61 string16 FindPluginNameWithIdentifier(const std::string& identifier); | 61 string16 FindPluginNameWithIdentifier(const std::string& identifier); |
62 | 62 |
63 // Gets plug-in metadata using |plugin|. | 63 // Gets plug-in metadata using |plugin|. |
64 scoped_ptr<PluginMetadata> GetPluginMetadata( | 64 scoped_ptr<PluginMetadata> GetPluginMetadata( |
(...skipping 22 matching lines...) Expand all Loading... |
87 std::map<std::string, PluginMetadata*> identifier_plugin_; | 87 std::map<std::string, PluginMetadata*> identifier_plugin_; |
88 | 88 |
89 // Synchronization for the above member variables is | 89 // Synchronization for the above member variables is |
90 // required since multiple threads can be accessing them concurrently. | 90 // required since multiple threads can be accessing them concurrently. |
91 base::Lock mutex_; | 91 base::Lock mutex_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(PluginFinder); | 93 DISALLOW_COPY_AND_ASSIGN(PluginFinder); |
94 }; | 94 }; |
95 | 95 |
96 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ | 96 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ |
OLD | NEW |