File: user_education_internals.mojom

package info (click to toggle)
chromium 140.0.7339.185-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,193,740 kB
  • sloc: cpp: 35,093,945; ansic: 7,161,670; javascript: 4,199,694; python: 1,441,797; asm: 949,904; xml: 747,515; pascal: 187,748; perl: 88,691; sh: 88,248; objc: 79,953; sql: 52,714; cs: 44,599; fortran: 24,137; makefile: 22,114; tcl: 15,277; php: 13,980; yacc: 9,000; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (135 lines) | stat: -rw-r--r-- 5,375 bytes parent folder | download | duplicates (5)
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();
};