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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 scoped_ptr<PluginMetadata>* plugin_metadata); | 54 scoped_ptr<PluginMetadata>* plugin_metadata); |
55 | 55 |
56 // Finds the plugin with the given identifier. If found, sets |installer| | 56 // Finds the plugin with the given identifier. If found, sets |installer| |
57 // to the corresponding PluginInstaller and |plugin_metadata| to a copy | 57 // to the corresponding PluginInstaller and |plugin_metadata| to a copy |
58 // of the corresponding PluginMetadata. |installer| may be NULL. | 58 // of the corresponding PluginMetadata. |installer| may be NULL. |
59 bool FindPluginWithIdentifier(const std::string& identifier, | 59 bool FindPluginWithIdentifier(const std::string& identifier, |
60 PluginInstaller** installer, | 60 PluginInstaller** installer, |
61 scoped_ptr<PluginMetadata>* plugin_metadata); | 61 scoped_ptr<PluginMetadata>* plugin_metadata); |
62 #endif | 62 #endif |
63 | 63 |
64 // Returns the plugin name with the given |identifier| or |identifier| if not | |
65 // found. | |
66 base::string16 FindPluginNameWithIdentifier(const std::string& identifier); | |
67 | |
68 // Returns the plugin name with the given |mime_type| and |language| or | |
69 // |mime_type| if not found. | |
70 base::string16 FindPluginName(const std::string& mime_type, | |
71 const std::string& language); | |
72 | |
73 // Gets plugin metadata using |plugin|. | 64 // Gets plugin metadata using |plugin|. |
74 scoped_ptr<PluginMetadata> GetPluginMetadata( | 65 scoped_ptr<PluginMetadata> GetPluginMetadata( |
75 const content::WebPluginInfo& plugin); | 66 const content::WebPluginInfo& plugin); |
76 | 67 |
77 private: | 68 private: |
78 friend struct base::DefaultSingletonTraits<PluginFinder>; | 69 friend struct base::DefaultSingletonTraits<PluginFinder>; |
79 FRIEND_TEST_ALL_PREFIXES(PluginFinderTest, JsonSyntax); | 70 FRIEND_TEST_ALL_PREFIXES(PluginFinderTest, JsonSyntax); |
80 FRIEND_TEST_ALL_PREFIXES(PluginFinderTest, PluginGroups); | 71 FRIEND_TEST_ALL_PREFIXES(PluginFinderTest, PluginGroups); |
81 | 72 |
82 PluginFinder(); | 73 PluginFinder(); |
(...skipping 15 matching lines...) Expand all Loading... |
98 int version_; | 89 int version_; |
99 | 90 |
100 // Synchronization for the above member variables is | 91 // Synchronization for the above member variables is |
101 // required since multiple threads can be accessing them concurrently. | 92 // required since multiple threads can be accessing them concurrently. |
102 base::Lock mutex_; | 93 base::Lock mutex_; |
103 | 94 |
104 DISALLOW_COPY_AND_ASSIGN(PluginFinder); | 95 DISALLOW_COPY_AND_ASSIGN(PluginFinder); |
105 }; | 96 }; |
106 | 97 |
107 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ | 98 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ |
OLD | NEW |