| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ | 6 #define EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| 11 #include "extensions/common/manifest.h" | 11 #include "extensions/common/manifest.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class FilePath; | 16 class FilePath; |
| 17 class Version; | 17 class Version; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 | 21 |
| 22 // This class is an abstract class for implementing external extensions | 22 // This class is an abstract class for implementing external extensions |
| 23 // providers. | 23 // providers. |
| 24 class ExternalProviderInterface { | 24 class ExternalProviderInterface { |
| 25 public: | 25 public: |
| 26 // ExternalProvider uses this interface to communicate back to the | 26 // ExternalProvider uses this interface to communicate back to the |
| 27 // caller what extensions are registered, and which |id|, |version| and |path| | 27 // caller what extensions are registered, and which |id|, |version| and |path| |
| 28 // they have. See also VisitRegisteredExtension below. Ownership of |version| | 28 // they have. See also VisitRegisteredExtension below. Ownership of |version| |
| 29 // is not transferred to the visitor. Callers of the methods below must | 29 // is not transferred to the visitor. Callers of the methods below must |
| 30 // ensure that |id| is a valid extension id (use Extension::IdIsValid(id)). | 30 // ensure that |id| is a valid extension id (use |
| 31 // crx_file::id_util::IdIsValid(id)). |
| 31 class VisitorInterface { | 32 class VisitorInterface { |
| 32 public: | 33 public: |
| 33 // Return true if the extension install will proceed. Install will not | 34 // Return true if the extension install will proceed. Install will not |
| 34 // proceed if the extension is already installed from a higher priority | 35 // proceed if the extension is already installed from a higher priority |
| 35 // location. | 36 // location. |
| 36 virtual bool OnExternalExtensionFileFound( | 37 virtual bool OnExternalExtensionFileFound( |
| 37 const std::string& id, | 38 const std::string& id, |
| 38 const base::Version* version, | 39 const base::Version* version, |
| 39 const base::FilePath& path, | 40 const base::FilePath& path, |
| 40 Manifest::Location location, | 41 Manifest::Location location, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // from its source. | 91 // from its source. |
| 91 virtual bool IsReady() const = 0; | 92 virtual bool IsReady() const = 0; |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 typedef std::vector<linked_ptr<ExternalProviderInterface> > | 95 typedef std::vector<linked_ptr<ExternalProviderInterface> > |
| 95 ProviderCollection; | 96 ProviderCollection; |
| 96 | 97 |
| 97 } // namespace extensions | 98 } // namespace extensions |
| 98 | 99 |
| 99 #endif // EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ | 100 #endif // EXTENSIONS_BROWSER_EXTERNAL_PROVIDER_INTERFACE_H_ |
| OLD | NEW |