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