1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module mojom.user_education_internals;
// Generic data about usage of a promo.
struct FeaturePromoDemoPageData {
// The data being described.
string name;
// The value of the data.
string value;
};
// Common feature block for both tutorials and IPH promos.
struct FeaturePromoDemoPageInfo {
// The title of the promo, to be presented to the user.
string display_title;
// The description of the promo, to be presented to the user.
string display_description;
// The actual key used to trigger the promo if it is chosen by the user.
string internal_name;
// The type of tutorial or IPH (e.g. "Toast", "Snooze", etc.)
string type;
// The milestone at which the tutorial or IPH was added.
int32 added_milestone;
// The list of supported platforms as text strings. (This mirrors the use on
// the flags page.)
array<string> supported_platforms;
// The names of other non-IPH features that must be enabled for this promo to
// display successfully.
array<string> required_features;
// A list of human-readable instructions on how to set the browser up so that
// the tutorial or IPH can be run.
array<string> instructions;
// The user education journey that follows this one, if any.
string followed_by_internal_name;
// Any additional data about the promo or tutorial.
array<FeaturePromoDemoPageData> data;
};
// What's New Module data.
struct WhatsNewModuleDemoPageInfo {
// The name of the module, to be presented to the user.
string display_title;
// The actual module name.
string module_name;
// Whether the module has an attached browser command.
bool has_browser_command;
// Whether the features associated with this module is enabled.
bool is_feature_enabled;
// The position of the modules in the enabled-queue.
int32 queue_position;
};
// What's New Edition data.
struct WhatsNewEditionDemoPageInfo {
// The name of the edition, to be presented to the user.
string display_title;
// The actual edition name.
string edition_name;
// Whether the features associated with this edition is enabled.
bool is_feature_enabled;
// Whether this edition has been shown to the user.
bool has_been_used;
// The major version of chrome this edition was shown.
int32 version_used;
};
// Provides access to browser-side user education data for
// chrome://user-education-internals
interface UserEducationInternalsPageHandler {
// Get the list of all available tutorials. Only needs to be called once
// since the browser-side list is static and does not change.
GetTutorials() => (array<FeaturePromoDemoPageInfo> tutorial_infos);
// Start a tutorial listed in the `GetTutorials` result.
// Returns an error message if the operation fails; empty string on success.
StartTutorial(string tutorial_id) => (string error_message);
// Returns a set of data about the current session state.
GetSessionData() => (array<FeaturePromoDemoPageData> session_data);
// Get the list of all available feature promos.
GetFeaturePromos() => (array<FeaturePromoDemoPageInfo> feature_promos);
// Start a feature promo from the list of available feature promos using the
// `feature_name`.
// Returns an error message if the operation fails; empty string on success.
ShowFeaturePromo(string feature_name) => (string error_message);
// Clears the data (snooze, show count, etc.) associated with a promo.
// Returns an error message if the operation fails; empty string on success.
ClearFeaturePromoData(string feature_name) => (string error_message);
// Clears all session-related User Education data.
// Returns an error message if the operation fails; empty string on success.
ClearSessionData() => (string error_message);
// Starts a new session at the current time.
// Returns an error message if the operation fails; empty string on success.
ForceNewSession() => (string error_message);
// Eliminates all current grace periods, allowing all eligible promos to show.
// Returns an error message if the operation fails; empty string on success.
RemoveGracePeriods() => (string error_message);
// Retrieves "New" Badge data.
GetNewBadges() => (array<FeaturePromoDemoPageInfo> new_badges);
// Retrieves What's New module data.
GetWhatsNewModules() => (array<WhatsNewModuleDemoPageInfo> whats_new_modules);
// Retrieves What's New edition data.
GetWhatsNewEditions() =>
(array<WhatsNewEditionDemoPageInfo> whats_new_editions);
// Retrieves NTP Promo data.
GetNtpPromos() => (array<FeaturePromoDemoPageInfo> ntp_promos);
// Clears "New" Badge data associated with a particular feature.
// Returns an error message if the operation fails; empty string on success.
ClearNewBadgeData(string feature_name) => (string error_message);
// Clears What's New data.
// Returns an error message if the operation fails; empty string on success.
ClearWhatsNewData() => (string error_message);
// Clears NTP Promo data for the specified promo ID.
// Returns an error message if the operation fails; empty string on success.
ClearNtpPromoData(string id) => (string error_message);
// Launches What's New page with for the staging environment.
LaunchWhatsNewStaging();
};
|