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_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 // ensure that |id| is a valid extension id (use Extension::IdIsValid(id)). | 25 // ensure that |id| is a valid extension id (use Extension::IdIsValid(id)). |
26 class VisitorInterface { | 26 class VisitorInterface { |
27 public: | 27 public: |
28 // Return true if the extension install will proceed. Install will not | 28 // Return true if the extension install will proceed. Install will not |
29 // proceed if the extension is already installed from a higher priority | 29 // proceed if the extension is already installed from a higher priority |
30 // location. | 30 // location. |
31 virtual bool OnExternalExtensionFileFound( | 31 virtual bool OnExternalExtensionFileFound( |
32 const std::string& id, | 32 const std::string& id, |
33 const Version* version, | 33 const Version* version, |
34 const FilePath& path, | 34 const FilePath& path, |
35 Extension::Location location, | 35 extensions::Extension::Location location, |
36 int creation_flags, | 36 int creation_flags, |
37 bool mark_acknowledged) = 0; | 37 bool mark_acknowledged) = 0; |
38 | 38 |
39 // Return true if the extension install will proceed. Install might not | 39 // Return true if the extension install will proceed. Install might not |
40 // proceed if the extension is already installed from a higher priority | 40 // proceed if the extension is already installed from a higher priority |
41 // location. | 41 // location. |
42 virtual bool OnExternalExtensionUpdateUrlFound( | 42 virtual bool OnExternalExtensionUpdateUrlFound( |
43 const std::string& id, | 43 const std::string& id, |
44 const GURL& update_url, | 44 const GURL& update_url, |
45 Extension::Location location) = 0; | 45 extensions::Extension::Location location) = 0; |
46 | 46 |
47 // Called after all the external extensions have been reported | 47 // Called after all the external extensions have been reported |
48 // through the above two methods. |provider| is a pointer to the | 48 // through the above two methods. |provider| is a pointer to the |
49 // provider that is now ready (typically this), and the | 49 // provider that is now ready (typically this), and the |
50 // implementation of OnExternalProviderReady() should be able to | 50 // implementation of OnExternalProviderReady() should be able to |
51 // safely assert that provider->IsReady(). | 51 // safely assert that provider->IsReady(). |
52 virtual void OnExternalProviderReady( | 52 virtual void OnExternalProviderReady( |
53 const ExternalExtensionProviderInterface* provider) = 0; | 53 const ExternalExtensionProviderInterface* provider) = 0; |
54 | 54 |
55 protected: | 55 protected: |
(...skipping 11 matching lines...) Expand all Loading... |
67 virtual void VisitRegisteredExtension() = 0; | 67 virtual void VisitRegisteredExtension() = 0; |
68 | 68 |
69 // Test if this provider has an extension with id |id| registered. | 69 // Test if this provider has an extension with id |id| registered. |
70 virtual bool HasExtension(const std::string& id) const = 0; | 70 virtual bool HasExtension(const std::string& id) const = 0; |
71 | 71 |
72 // Gets details of an extension by its id. Output params will be set only | 72 // Gets details of an extension by its id. Output params will be set only |
73 // if they are not NULL. If an output parameter is not specified by the | 73 // if they are not NULL. If an output parameter is not specified by the |
74 // provider type, it will not be changed. | 74 // provider type, it will not be changed. |
75 // This function is no longer used outside unit tests. | 75 // This function is no longer used outside unit tests. |
76 virtual bool GetExtensionDetails(const std::string& id, | 76 virtual bool GetExtensionDetails(const std::string& id, |
77 Extension::Location* location, | 77 extensions::Extension::Location* location, |
78 scoped_ptr<Version>* version) const = 0; | 78 scoped_ptr<Version>* version) const = 0; |
79 | 79 |
80 // Determines if this provider had loaded the list of external extensions | 80 // Determines if this provider had loaded the list of external extensions |
81 // from its source. | 81 // from its source. |
82 virtual bool IsReady() const = 0; | 82 virtual bool IsReady() const = 0; |
83 }; | 83 }; |
84 | 84 |
85 typedef std::vector<linked_ptr<ExternalExtensionProviderInterface> > | 85 typedef std::vector<linked_ptr<ExternalExtensionProviderInterface> > |
86 ProviderCollection; | 86 ProviderCollection; |
87 | 87 |
88 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ | 88 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_EXTENSION_PROVIDER_INTERFACE_H_ |
OLD | NEW |