[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / crx_file / crx_creator.h
1 // Copyright 2017 The Chromium Authors
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 COMPONENTS_CRX_FILE_CRX_CREATOR_H_
6 #define COMPONENTS_CRX_FILE_CRX_CREATOR_H_
7
8 #include <string>
9
10 namespace base {
11 class FilePath;
12 }  // namespace base
13
14 namespace crypto {
15 class RSAPrivateKey;
16 }  // namespace crypto
17
18 namespace crx_file {
19
20 enum class CreatorResult {
21   OK,  // The CRX file was successfully created.
22   ERROR_SIGNING_FAILURE,
23   ERROR_FILE_NOT_READABLE,
24   ERROR_FILE_NOT_WRITABLE,
25   ERROR_FILE_WRITE_FAILURE,
26 };
27
28 // Similar to `Create` method but also injects `verified_contents` into the
29 // header.
30 CreatorResult CreateCrxWithVerifiedContentsInHeader(
31     const base::FilePath& output_path,
32     const base::FilePath& zip_path,
33     crypto::RSAPrivateKey* signing_key,
34     const std::string& verified_contents);
35
36 // Create a CRX3 file at |output_path|, using the contents of the ZIP archive
37 // located at |zip_path| and signing with (and deriving the CRX ID from)
38 // |signing_key|.
39 CreatorResult Create(const base::FilePath& output_path,
40                      const base::FilePath& zip_path,
41                      crypto::RSAPrivateKey* signing_key);
42
43 }  // namespace crx_file
44
45 #endif  // COMPONENTS_CRX_FILE_CRX_CREATOR_H_