blob: 7b06ddde734a3f0534c753cd12a284bf1bd6473f [file] [log] [blame]
Avi Drissman60039d42022-09-13 21:49:051// Copyright 2016 The Chromium Authors
lazyboye8634172016-01-28 00:10:482// 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 Cronind4c2a8f32017-09-29 17:08:309#include "base/version.h"
lazyboye8634172016-01-28 00:10:4810#include "extensions/common/manifest.h"
Gyuyoung Kim2e954c42021-03-19 14:06:2911#include "extensions/common/mojom/manifest.mojom-shared.h"
Devlin Cronind4c2a8f32017-09-29 17:08:3012#include "url/gurl.h"
lazyboye8634172016-01-28 00:10:4813
14namespace extensions {
15
16// Holds information about an external extension install from an external
17// provider.
18struct ExternalInstallInfo {
19 ExternalInstallInfo(const std::string& extension_id,
20 int creation_flags,
21 bool mark_acknowledged);
Peter Boströmc3d907172021-09-24 18:39:5222 ExternalInstallInfo(const ExternalInstallInfo&) = delete;
23 ExternalInstallInfo& operator=(const ExternalInstallInfo&) = delete;
Devlin Cronin19f70b6a2017-10-01 04:14:0524 ExternalInstallInfo(ExternalInstallInfo&& other);
lazyboye8634172016-01-28 00:10:4825 virtual ~ExternalInstallInfo() {}
26
27 std::string extension_id;
28 int creation_flags;
29 bool mark_acknowledged;
lazyboye8634172016-01-28 00:10:4830};
31
32struct ExternalInstallInfoFile : public ExternalInstallInfo {
33 ExternalInstallInfoFile(const std::string& extension_id,
Devlin Cronind4c2a8f32017-09-29 17:08:3034 const base::Version& version,
lazyboye8634172016-01-28 00:10:4835 const base::FilePath& path,
Gyuyoung Kim2e954c42021-03-19 14:06:2936 mojom::ManifestLocation crx_location,
lazyboye8634172016-01-28 00:10:4837 int creation_flags,
38 bool mark_acknowledged,
39 bool install_immediately);
Devlin Cronin19f70b6a2017-10-01 04:14:0540 ExternalInstallInfoFile(ExternalInstallInfoFile&& other);
lazyboye8634172016-01-28 00:10:4841 ~ExternalInstallInfoFile() override;
42
Devlin Cronind4c2a8f32017-09-29 17:08:3043 base::Version version;
lazyboye8634172016-01-28 00:10:4844 base::FilePath path;
Gyuyoung Kim2e954c42021-03-19 14:06:2945 mojom::ManifestLocation crx_location;
lazyboye8634172016-01-28 00:10:4846 bool install_immediately;
47};
48
49struct ExternalInstallInfoUpdateUrl : public ExternalInstallInfo {
50 ExternalInstallInfoUpdateUrl(const std::string& extension_id,
51 const std::string& install_parameter,
Devlin Cronind4c2a8f32017-09-29 17:08:3052 GURL update_url,
Gyuyoung Kim2e954c42021-03-19 14:06:2953 mojom::ManifestLocation download_location,
lazyboye8634172016-01-28 00:10:4854 int creation_flags,
55 bool mark_acknowledged);
Devlin Cronin19f70b6a2017-10-01 04:14:0556 ExternalInstallInfoUpdateUrl(ExternalInstallInfoUpdateUrl&& other);
lazyboye8634172016-01-28 00:10:4857 ~ExternalInstallInfoUpdateUrl() override;
58
59 std::string install_parameter;
Devlin Cronind4c2a8f32017-09-29 17:08:3060 GURL update_url;
Gyuyoung Kim2e954c42021-03-19 14:06:2961 mojom::ManifestLocation download_location;
lazyboye8634172016-01-28 00:10:4862};
63
64} // namespace extensions
65#endif // EXTENSIONS_BROWSER_EXTERNAL_INSTALL_INFO_H_