| 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 19 matching lines...) Expand all Loading... |
| 30 // This class should be created and initialized by calling | 30 // This class should be created and initialized by calling |
| 31 // |GetInstance()| and |Init()| on the UI thread. | 31 // |GetInstance()| and |Init()| on the UI thread. |
| 32 // After that it can be safely used on any other thread. | 32 // After that it can be safely used on any other thread. |
| 33 class PluginFinder { | 33 class PluginFinder { |
| 34 public: | 34 public: |
| 35 static PluginFinder* GetInstance(); | 35 static PluginFinder* GetInstance(); |
| 36 | 36 |
| 37 // It should be called on the UI thread. | 37 // It should be called on the UI thread. |
| 38 void Init(); | 38 void Init(); |
| 39 | 39 |
| 40 // TODO(ibraaaa): DELETE. http://crbug.com/124396 | |
| 41 static void Get(const base::Callback<void(PluginFinder*)>& cb); | |
| 42 | |
| 43 #if defined(ENABLE_PLUGIN_INSTALLATION) | 40 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 44 // Finds a plug-in for the given MIME type and language (specified as an IETF | 41 // Finds a plug-in for the given MIME type and language (specified as an IETF |
| 45 // language tag, i.e. en-US) and returns the PluginInstaller for the plug-in, | 42 // language tag, i.e. en-US) and returns the PluginInstaller for the plug-in, |
| 46 // or NULL if no plug-in is found. | 43 // or NULL if no plug-in is found. |
| 47 PluginInstaller* FindPlugin(const std::string& mime_type, | 44 PluginInstaller* FindPlugin(const std::string& mime_type, |
| 48 const std::string& language); | 45 const std::string& language); |
| 49 | 46 |
| 50 // Returns the plug-in with the given identifier. | 47 // Returns the plug-in with the given identifier. |
| 51 PluginInstaller* FindPluginWithIdentifier(const std::string& identifier); | 48 PluginInstaller* FindPluginWithIdentifier(const std::string& identifier); |
| 52 #endif | 49 #endif |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 88 |
| 92 // Synchronization for |installers_|, |identifier_plugin_| and | 89 // Synchronization for |installers_|, |identifier_plugin_| and |
| 93 // |name_plugin_| are required since multiple threads | 90 // |name_plugin_| are required since multiple threads |
| 94 // can be accessing them concurrently. | 91 // can be accessing them concurrently. |
| 95 base::Lock mutex_; | 92 base::Lock mutex_; |
| 96 | 93 |
| 97 DISALLOW_COPY_AND_ASSIGN(PluginFinder); | 94 DISALLOW_COPY_AND_ASSIGN(PluginFinder); |
| 98 }; | 95 }; |
| 99 | 96 |
| 100 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ | 97 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_FINDER_H_ |
| OLD | NEW |