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_PROVIDER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/external_provider_interface.h" | 10 #include "chrome/browser/extensions/external_provider_interface.h" |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "chrome/browser/extensions/external_loader.h" | 13 #include "chrome/browser/extensions/external_loader.h" |
14 #include "extensions/common/manifest.h" | 14 #include "extensions/common/manifest.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class Version; | 20 class Version; |
21 } | 21 } |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
| 24 class ExternalLoader; |
24 | 25 |
25 // A specialization of the ExternalProvider that uses an instance of | 26 // A specialization of the ExternalProvider that uses an instance of |
26 // ExternalLoader to provide external extensions. This class can be seen as a | 27 // ExternalLoader to provide external extensions. This class can be seen as a |
27 // bridge between the extension system and an ExternalLoader. Instances live | 28 // bridge between the extension system and an ExternalLoader. Instances live |
28 // their entire life on the UI thread. | 29 // their entire life on the UI thread. |
29 class ExternalProviderImpl : public ExternalProviderInterface { | 30 class ExternalProviderImpl : public ExternalProviderInterface { |
30 public: | 31 public: |
31 // The constructed provider will provide the extensions loaded from |loader| | 32 // The constructed provider will provide the extensions loaded from |loader| |
32 // to |service|, that will deal with the installation. The location | 33 // to |service|, that will deal with the installation. The location |
33 // attributes of the provided extensions are also specified here: | 34 // attributes of the provided extensions are also specified here: |
34 // |crx_location|: extensions originating from crx files | 35 // |crx_location|: extensions originating from crx files |
35 // |download_location|: extensions originating from update URLs | 36 // |download_location|: extensions originating from update URLs |
36 // If either of the origins is not supported by this provider, then it should | 37 // If either of the origins is not supported by this provider, then it should |
37 // be initialized as Manifest::INVALID_LOCATION. | 38 // be initialized as Manifest::INVALID_LOCATION. |
38 ExternalProviderImpl(VisitorInterface* service, | 39 ExternalProviderImpl(VisitorInterface* service, |
39 const scoped_refptr<ExternalLoader>& loader, | 40 ExternalLoader* loader, |
40 Profile* profile, | 41 Profile* profile, |
41 Manifest::Location crx_location, | 42 Manifest::Location crx_location, |
42 Manifest::Location download_location, | 43 Manifest::Location download_location, |
43 int creation_flags); | 44 int creation_flags); |
44 | 45 |
45 virtual ~ExternalProviderImpl(); | 46 virtual ~ExternalProviderImpl(); |
46 | 47 |
47 // Populates a list with providers for all known sources. | 48 // Populates a list with providers for all known sources. |
48 static void CreateExternalProviders( | 49 static void CreateExternalProviders( |
49 VisitorInterface* service, | 50 VisitorInterface* service, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // Whether loaded extensions should be automatically acknowledged, so that | 113 // Whether loaded extensions should be automatically acknowledged, so that |
113 // the user doesn't see an alert about them. | 114 // the user doesn't see an alert about them. |
114 bool auto_acknowledge_; | 115 bool auto_acknowledge_; |
115 | 116 |
116 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); | 117 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); |
117 }; | 118 }; |
118 | 119 |
119 } // namespace extensions | 120 } // namespace extensions |
120 | 121 |
121 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 122 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
OLD | NEW |