blob: 9e0f2d92a1b405ca8001ab1bf706cce1b2b8edb9 [file] [log] [blame]
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module ash.help_app.mojom;
import "url/mojom/url.mojom";
// Device info obtained via the DeviceInfoManager.
struct DeviceInfo {
// The board family of the device. e.g. "brya".
string board;
// The model of the device. e.g. "taniks".
string model;
// The user type of the profile currently running. e.g. "unmanaged".
// The possible values for this can be found at
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/apps/user_type_filter.cc;l=27;drc=0d0b76e40dfff0f4ad58d0640cdf2c4df72030d3.
string user_type;
// If Steam is allowed for the device, regardless of install status.
bool is_steam_allowed;
};
/**
* These values correspond to the ActionType enum found at
* https://source.chromium.org/chromium/chromium/src/+/main:chromeos/ash/components/scalable_iph/scalable_iph_constants.h;drc=ea198b54e3f6b0cfdd6bacbb01c2307fd1797b63;l=10.
*/
enum ActionTypeId {
INVALID = 0,
OPEN_CHROME = 1,
OPEN_LAUNCHER = 2,
OPEN_PERSONALIZATION_APP = 3,
OPEN_PLAY_STORE = 4,
OPEN_GOOGLE_DOCS = 5,
OPEN_GOOGLE_PHOTOS = 6,
OPEN_SETTINGS_PRINTER = 7,
OPEN_PHONE_HUB = 8,
OPEN_YOUTUBE = 9,
OPEN_FILE_MANAGER = 10,
};
/**
* Components (or paths) in OS Settings that OpenSettings is allowed to open.
* These are a subset of the paths in
* ash/webui/settings/public/constants/routes.mojom
* go/help-app-open-settings-paths links here.
* Do not change or reuse values.
*/
enum SettingsComponent {
// The home page of settings. No particular section or subpage.
HOME = 0,
ACCESSIBILITY = 1,
BLUETOOTH = 2,
DISPLAY = 3,
INPUT = 4,
MULTI_DEVICE = 5,
PEOPLE = 6,
PER_DEVICE_KEYBOARD = 7,
PER_DEVICE_TOUCHPAD = 8,
PERSONALIZATION = 9,
PRINTING = 10,
SECURITY_AND_SIGN_IN = 11,
TOUCHPAD_REVERSE_SCROLLING = 12,
TOUCHPAD_SIMULATE_RIGHT_CLICK = 13,
};
// Browser interface for chrome://help-app to bootstrap a connection.
interface PageHandlerFactory {
// Create a page handler which exposes interfaces implemented in the browser
// process to the renderer process via |handler|.
CreatePageHandler(pending_receiver<PageHandler> handler);
};
// An interface implemented in the browser process that is exposed to the
// renderer process for chrome://help-app.
interface PageHandler {
// Opens the chrome feedback dialog.
OpenFeedbackDialog() => (string? error_message);
// Opens the on device app controls part of OS settings.
ShowOnDeviceAppControls();
// Opens the parental controls part of OS settings.
ShowParentalControls();
// Triggers the call-to-action associated with the given action type id.
TriggerWelcomeTipCallToAction(ActionTypeId action_type_id);
// Returns true if the Help App Launcher Search feature is enabled.
IsLauncherSearchEnabled() => (bool enabled);
// Launches the MS365 setup flow (or shows the final screen of the flow if it
// was already completed).
LaunchMicrosoft365Setup();
// Request for the help app release notes notification to be shown, if a
// notification for the Help App has not yet been shown in the current
// milestone.
MaybeShowReleaseNotesNotification();
// Returns device info obtained via the DeviceInfoManager.
GetDeviceInfo() => (DeviceInfo device_info);
// Opens a valid https:// URL in a new browser tab without getting intercepted
// by URL capturing logic. If the "HelpAppAutoTriggerInstallDialog" feature
// flag is enabled, this will automatically trigger the install dialog.
// Failure to provide a valid https:// URL will cause the Help app renderer
// process to crash.
OpenUrlInBrowserAndTriggerInstallDialog(url.mojom.Url url);
// Opens an os settings for the specified settings component. If a specified
// component is not available on a device, e.g., a trackpad settings specified
// while a device does not have it, it is handled as no-op.
OpenSettings(SettingsComponent component);
// Sets the HasCompletedNewDeviceChecklist pref to true. Call this after the
// user completes the checklist.
SetHasCompletedNewDeviceChecklist();
// Sets the HasVisitedHowToPage pref to true. Call this after the user visits
// the how to page.
SetHasVisitedHowToPage();
};