OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | |
10 #include <string> | |
11 | |
12 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
13 | 10 |
14 class FilePath; | 11 class FilePath; |
15 class Version; | 12 class Version; |
16 | 13 |
17 // This class is an abstract class for implementing external extensions | 14 // This class is an abstract class for implementing external extensions |
18 // providers. | 15 // providers. |
19 class ExternalExtensionProvider { | 16 class ExternalExtensionProvider { |
20 public: | 17 public: |
21 // ExternalExtensionProvider uses this interface to communicate back to the | 18 // ExternalExtensionProvider uses this interface to communicate back to the |
(...skipping 15 matching lines...) Expand all Loading... |
37 | 34 |
38 protected: | 35 protected: |
39 virtual ~Visitor() {} | 36 virtual ~Visitor() {} |
40 }; | 37 }; |
41 | 38 |
42 virtual ~ExternalExtensionProvider() {} | 39 virtual ~ExternalExtensionProvider() {} |
43 | 40 |
44 // Enumerate registered extension, calling OnExternalExtensionFound on | 41 // Enumerate registered extension, calling OnExternalExtensionFound on |
45 // the |visitor| object for each registered extension found. |ids_to_ignore| | 42 // the |visitor| object for each registered extension found. |ids_to_ignore| |
46 // contains a list of extension ids that should not result in a call back. | 43 // contains a list of extension ids that should not result in a call back. |
47 virtual void VisitRegisteredExtension( | 44 virtual void VisitRegisteredExtension(Visitor* visitor) const = 0; |
48 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const = 0; | |
49 | 45 |
50 // Test if this provider has an extension with id |id| registered. | 46 // Test if this provider has an extension with id |id| registered. |
51 virtual bool HasExtension(const std::string& id) const = 0; | 47 virtual bool HasExtension(const std::string& id) const = 0; |
52 | 48 |
53 // Gets details of an extension by its id. Output params will be set only | 49 // Gets details of an extension by its id. Output params will be set only |
54 // if they are not NULL. If an output parameter is not specified by the | 50 // if they are not NULL. If an output parameter is not specified by the |
55 // provider type, it will not be changed. | 51 // provider type, it will not be changed. |
56 // This function is no longer used outside unit tests. | 52 // This function is no longer used outside unit tests. |
57 virtual bool GetExtensionDetails(const std::string& id, | 53 virtual bool GetExtensionDetails(const std::string& id, |
58 Extension::Location* location, | 54 Extension::Location* location, |
59 scoped_ptr<Version>* version) const = 0; | 55 scoped_ptr<Version>* version) const = 0; |
60 }; | 56 }; |
61 | 57 |
62 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ | 58 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_H_ |
OLD | NEW |