blob: cb990d58a7fda44fc53a4574b904e27b7c936522 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module chrome.mojom;
import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom";
enum SelectFileDialogType {
kNone,
// For opening a folder.
kFolder,
// Like kFolder, but the dialog UI should explicitly show it's
// specifically for "upload".
kUploadFolder,
// Like kFolder, but folder creation is disabled, if possible.
kExistingFolder,
// For saving into a file, allowing a nonexistent file to be selected.
kSaveAsFile,
// For opening a file.
kOpenFile,
// Like kOpenFile, but allowing multiple files to open.
kOpenMultiFile,
};
struct FileFilterSpec {
mojo_base.mojom.String16 description;
mojo_base.mojom.String16 extension_spec;
};
enum CertificateType {
// The module is not signed.
kNoCertificate,
// The module is signed and the certificate is in the module.
kCertificateInFile,
// The module is signed and the certificate is in an external catalog.
kCertificateInCatalog,
};
struct InspectionResult {
// The lowercase module path, not including the basename.
mojo_base.mojom.String16 location;
// The basename of the module.
mojo_base.mojom.String16 basename;
// The name of the product the module belongs to.
mojo_base.mojom.String16 product_name;
// The module file description.
mojo_base.mojom.String16 description;
// The module version. This is usually in the form a.b.c.d (where a, b, c and
// d are integers), but may also have fewer than 4 components.
mojo_base.mojom.String16 version;
// The type of the certificate for this module.
CertificateType certificate_type;
// Path to the file containing the certificate. Empty if |certificate_type| is
// kNoCertificate.
mojo_base.mojom.FilePath certificate_path;
// The "Subject" name of the certificate. This is the signer (ie,
// "Google Inc." or "Microsoft Inc.").
mojo_base.mojom.String16 certificate_subject;
};
// Utility process interface exposed to the browser process on OS_WIN. Used to
// improve stability by executing some tasks out-of-process. This include either
// crashy tasks, or tasks that requires certain DLLs to be loaded into the
// process address space that we don't want to load in the main process.
interface UtilWin {
// Returns the pinned state of the current executable.
IsPinnedToTaskbar() => (bool succeeded, bool is_pinned_to_taskbar);
// Executes a select file operation that can be executed on a utility process.
// |owner|:
// The HWND that owns the file dialog.
// |title|:
// The title of the file dialog.
// |default_path|:
// The path that is selected by default when the dialog is opened.
// |filter|:
// Filters which files are shown based on the file extension. Ignored for
// folder selection dialogs (kFolder, kUploadFolder, kExistingFolder).
// |file_type_index|:
// The index of the file extension filter that should be selected when the
// dialog is first opened. Ignored for folder selection dialogs (kFolder,
// kUploadFolder, kExistingFolder).
// |default_extension|:
// The extension that should automatically be appended to a filename if it
// doesn't have one. This is only used for kSaveAsFile dialogs.
//
// Returns the selected file |paths| and the |file_type_index| of the filter
// selected by the user. The |file_type_index| return value is meaningless on
// folder selection dialogs. On cancelation or failure, |paths| will be empty.
CallExecuteSelectFile(SelectFileDialogType type,
uint32 owner,
mojo_base.mojom.String16 title,
mojo_base.mojom.FilePath default_path,
array<FileFilterSpec> filter,
int32 file_type_index,
mojo_base.mojom.String16 default_extension) =>
(array<mojo_base.mojom.FilePath> paths,
int32 file_type_index);
// Given a module located at |module_path|, returns a populated
// ModuleInspectionResult that contains detailed information about the module
// on disk.
InspectModule(mojo_base.mojom.FilePath module_path) =>
(InspectionResult inspection_result);
};