blob: f475fcddee04e12b5661130b059daa7cf7c9342d [file] [log] [blame]
// Copyright 2017 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_cleaner.mojom;
// IMPORTANT NOTE: Avoid adding dependencies to typemapped .mojom files.
// Enabling typemaps currently (as of July 2017) requires indirectly depending
// on all existing typemap definitions. The Chrome Cleaner is built
// independently from Chromium and would like to avoid these dependencies.
// Once it's possible to specify a limited subset of typemaps to use, be
// careful not to add dependencies to [Native] mojo structures. The wire format
// for [Native] structs is not guaranteed to be consistent between versions.
[Extensible]
enum PromptAcceptance {
UNSPECIFIED = 0,
// The user explicitly accepted the cleanup operation and cleaner logs
// upload is allowed.
ACCEPTED_WITH_LOGS = 1,
// The user explicitly accepted the cleanup operation and cleaner logs
// upload is not allowed.
ACCEPTED_WITHOUT_LOGS = 2,
// The user explicitly denied the Chrome prompt.
DENIED = 3,
NUM_VALUES,
};
struct FilePath {
array<uint16> value;
};
struct RegistryKey {
// A string formatted for display to the user.
// Example: HKCU:32\software\unwanted_software
array<uint16> value;
};
struct ExtensionId {
// A 32-character extension ID.
array<uint16> value;
};
// Service provided by Chrome to prompt the user to start a cleanup if the
// Chrome Cleanup Tool detects unwanted software on the system.
interface ChromePrompt {
// Params:
// - files_to_delete: list of fully-qualified paths of the files that will
// be deleted by the Chrome Cleanup Tool.
// - registry_keys: list of fully-qualified paths of the registry keys that
// will be changed or deleted by the Chrome Cleanup Tool.
// - extension_ids: list of IDs of extensions that will be removed by the
// Chrome Cleanup Tool.
// Returns:
// - prompt_acceptance: indicates if the user accepted the prompt.
PromptUser(array<FilePath> files_to_delete,
[MinVersion=1] array<RegistryKey>? registry_keys,
[MinVersion=2] array<ExtensionId>? extension_ids)
=> (PromptAcceptance prompt_acceptance);
// Actually uninstalls the extensions.
// Params:
// - extension_ids: list of IDs of extensions that will be removed from
// Chrome. If there are any invalid IDs, none are removed and false is
// returned.
// Returns:
// - success: indicates if the extension removal was successful.
[MinVersion=3] DisableExtensions(array<ExtensionId> extension_ids)
=> (bool success);
};