Avi Drissman | 60039d4 | 2022-09-13 21:49:05 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_BROWSER_EXTERNAL_INSTALL_INFO_H_ |
| 6 | #define EXTENSIONS_BROWSER_EXTERNAL_INSTALL_INFO_H_ |
| 7 | |
| 8 | #include "base/files/file_path.h" |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 9 | #include "base/version.h" |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 10 | #include "extensions/common/manifest.h" |
Gyuyoung Kim | 2e954c4 | 2021-03-19 14:06:29 | [diff] [blame] | 11 | #include "extensions/common/mojom/manifest.mojom-shared.h" |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 12 | #include "url/gurl.h" |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 13 | |
| 14 | namespace extensions { |
| 15 | |
| 16 | // Holds information about an external extension install from an external |
| 17 | // provider. |
| 18 | struct ExternalInstallInfo { |
| 19 | ExternalInstallInfo(const std::string& extension_id, |
| 20 | int creation_flags, |
| 21 | bool mark_acknowledged); |
Peter Boström | c3d90717 | 2021-09-24 18:39:52 | [diff] [blame] | 22 | ExternalInstallInfo(const ExternalInstallInfo&) = delete; |
| 23 | ExternalInstallInfo& operator=(const ExternalInstallInfo&) = delete; |
Devlin Cronin | 19f70b6a | 2017-10-01 04:14:05 | [diff] [blame] | 24 | ExternalInstallInfo(ExternalInstallInfo&& other); |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 25 | virtual ~ExternalInstallInfo() {} |
| 26 | |
| 27 | std::string extension_id; |
| 28 | int creation_flags; |
| 29 | bool mark_acknowledged; |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | struct ExternalInstallInfoFile : public ExternalInstallInfo { |
| 33 | ExternalInstallInfoFile(const std::string& extension_id, |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 34 | const base::Version& version, |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 35 | const base::FilePath& path, |
Gyuyoung Kim | 2e954c4 | 2021-03-19 14:06:29 | [diff] [blame] | 36 | mojom::ManifestLocation crx_location, |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 37 | int creation_flags, |
| 38 | bool mark_acknowledged, |
| 39 | bool install_immediately); |
Devlin Cronin | 19f70b6a | 2017-10-01 04:14:05 | [diff] [blame] | 40 | ExternalInstallInfoFile(ExternalInstallInfoFile&& other); |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 41 | ~ExternalInstallInfoFile() override; |
| 42 | |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 43 | base::Version version; |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 44 | base::FilePath path; |
Gyuyoung Kim | 2e954c4 | 2021-03-19 14:06:29 | [diff] [blame] | 45 | mojom::ManifestLocation crx_location; |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 46 | bool install_immediately; |
| 47 | }; |
| 48 | |
| 49 | struct ExternalInstallInfoUpdateUrl : public ExternalInstallInfo { |
| 50 | ExternalInstallInfoUpdateUrl(const std::string& extension_id, |
| 51 | const std::string& install_parameter, |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 52 | GURL update_url, |
Gyuyoung Kim | 2e954c4 | 2021-03-19 14:06:29 | [diff] [blame] | 53 | mojom::ManifestLocation download_location, |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 54 | int creation_flags, |
| 55 | bool mark_acknowledged); |
Devlin Cronin | 19f70b6a | 2017-10-01 04:14:05 | [diff] [blame] | 56 | ExternalInstallInfoUpdateUrl(ExternalInstallInfoUpdateUrl&& other); |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 57 | ~ExternalInstallInfoUpdateUrl() override; |
| 58 | |
| 59 | std::string install_parameter; |
Devlin Cronin | d4c2a8f3 | 2017-09-29 17:08:30 | [diff] [blame] | 60 | GURL update_url; |
Gyuyoung Kim | 2e954c4 | 2021-03-19 14:06:29 | [diff] [blame] | 61 | mojom::ManifestLocation download_location; |
lazyboy | e863417 | 2016-01-28 00:10:48 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | } // namespace extensions |
| 65 | #endif // EXTENSIONS_BROWSER_EXTERNAL_INSTALL_INFO_H_ |