blob: 39b42a0ae06fa3732c9710bd5e1c1fa74f98a6a4 [file] [log] [blame]
lazyboye8634172016-01-28 00:10:481// Copyright 2016 The Chromium Authors. All rights reserved.
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"
lazyboye8634172016-01-28 00:10:489#include "extensions/common/manifest.h"
10
11class GURL;
12
13namespace base {
14class Version;
15}
16
17namespace extensions {
18
19// Holds information about an external extension install from an external
20// provider.
21struct ExternalInstallInfo {
22 ExternalInstallInfo(const std::string& extension_id,
23 int creation_flags,
24 bool mark_acknowledged);
25 virtual ~ExternalInstallInfo() {}
26
27 std::string extension_id;
28 int creation_flags;
29 bool mark_acknowledged;
30
31 private:
32 DISALLOW_COPY_AND_ASSIGN(ExternalInstallInfo);
33};
34
35struct ExternalInstallInfoFile : public ExternalInstallInfo {
36 ExternalInstallInfoFile(const std::string& extension_id,
dchengf5d241082016-04-21 03:43:1137 std::unique_ptr<base::Version> version,
lazyboye8634172016-01-28 00:10:4838 const base::FilePath& path,
39 Manifest::Location crx_location,
40 int creation_flags,
41 bool mark_acknowledged,
42 bool install_immediately);
43 ~ExternalInstallInfoFile() override;
44
dchengf5d241082016-04-21 03:43:1145 std::unique_ptr<base::Version> version;
lazyboye8634172016-01-28 00:10:4846 base::FilePath path;
47 Manifest::Location crx_location;
48 bool install_immediately;
49};
50
51struct ExternalInstallInfoUpdateUrl : public ExternalInstallInfo {
52 ExternalInstallInfoUpdateUrl(const std::string& extension_id,
53 const std::string& install_parameter,
dchengf5d241082016-04-21 03:43:1154 std::unique_ptr<GURL> update_url,
lazyboye8634172016-01-28 00:10:4855 Manifest::Location download_location,
56 int creation_flags,
57 bool mark_acknowledged);
58 ~ExternalInstallInfoUpdateUrl() override;
59
60 std::string install_parameter;
dchengf5d241082016-04-21 03:43:1161 std::unique_ptr<GURL> update_url;
lazyboye8634172016-01-28 00:10:4862 Manifest::Location download_location;
63};
64
65} // namespace extensions
66#endif // EXTENSIONS_BROWSER_EXTERNAL_INSTALL_INFO_H_