File: user_education_internals.mojom

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (120 lines) | stat: -rw-r--r-- 4,699 bytes parent folder | download | duplicates (3)
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
// 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);

  // 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);

  // 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);

  // Launches What's New page with for the staging environment.
  LaunchWhatsNewStaging();
};