File: app_preload.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (186 lines) | stat: -rw-r--r-- 7,193 bytes parent folder | download | duplicates (6)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package apps.proto;

import "chrome/browser/apps/almanac_api_client/proto/client_context.proto";

// This file is a mirror of the proto file maintained in the server code base at
// go/app-preload-service-proto. Changes should be made by updating the
// server code base and then copying the result to Chromium.

message AppPreloadListRequest {
  // Context information about the device making this request.
  optional ClientDeviceContext device_context = 1;

  // Context information about the user making this request.
  optional ClientUserContext user_context = 2;
}

message AppPreloadListResponse {
  // A list of zero or more apps for APS to install.
  repeated App apps_to_install = 1;

  // The Launcher Configuration.
  repeated LauncherConfig launcher_config = 2;

  // The Shelf Configuration.
  repeated ShelfConfig shelf_config = 3;

  enum InstallReason {
    // Default for deserialization when an unexpected value is encountered.
    // Usually indicates to the client that the server has a new reason and
    // needs the proto file updated.
    INSTALL_REASON_UNKNOWN = 0;

    // An app other than an OEM app. This should be pinned in the Launcher at
    // the position that matches the PackageId or, if not specified, into the
    // end of the "OTHER" position, as defined in the launcher config.
    INSTALL_REASON_DEFAULT = 1;

    // An app installed for an OEM. This should be placed into the "OEM" folder
    // defined in the launcher config.
    // (note: position in the OEM folder itself does not matter).
    INSTALL_REASON_OEM = 2;

    // An app which is being returned by the server for testing purposes.
    // This generally will be ignored by the client unless it is configured
    // in some sort of test mode.
    INSTALL_REASON_TEST = 3;
  }

  // For Android-only metadata.
  // Note: Once Unified App Install has been hooked up, this will be deprecated.
  message AndroidExtras {}

  // For Web-only metadata.
  // Note: Once Unified App Install has been hooked up, this will be deprecated.
  message WebExtras {
    // A URL to the web app's manifest in json format. This will always be from
    // the host meltingpot.googleusercontent.com.
    optional string manifest_url = 1;

    // The URL for the original source used to retrieve the contents of the
    // manifest above. This is needed to resolve the file on the client-side.
    optional string original_manifest_url = 2;
  }

  message App {
    // The primary key for the installer. This will always be of the format
    // "platform:primary_key". For now we support "android:package_name" and
    // "web:http://manifest/id".
    optional string package_id = 1;

    // The identifier for the App Group that Fondue used to derive this app
    // instance in the response.
    // Note: this may not be unique in the apps_to_install collection.
    optional string app_group_uuid = 2;

    // The App's UTF-8 encoded name in the requested language (or next best).
    optional string name = 3;

    // Icons (which are not currently used).
    reserved 4;

    // The reason why this app is in the list.
    optional InstallReason install_reason = 5;

    // An optional campaign code for this preload.
    optional string campaign_code = 8;

    // The localised folder name that this preload should be placed in.
    // Note: this is not populated and should be ignored for OEM preloads.
    optional string folder_name = 9;

    // Every platform has its own [Platform]Extras message to store platform
    // specific metadata.
    // Note: Once Unified App Install has been hooked up, this will be
    // deprecated.
    oneof extras {
      AndroidExtras android_extras = 6;
      WebExtras web_extras = 7;
    }
  }

  // Configuration defining the order of apps pinned in the Shelf.
  message ShelfConfig {
    // The order of the entries in this config. Sort by this value and then
    // process in ascending order.
    optional uint32 order = 1;

    // An optional feature flag. If specified, evaluate the flag and ignore this
    // entry if the feature is not enabled.
    optional string feature_flag = 2;

    // The identifier for the app for this slot (usually one). If more than one
    // is specified, evaluate the entries in order and place the first app
    // detected on the device in this slot. Ignore the remaining entries.
    repeated string package_id = 3;
  }

  // Indicates the type of Launcher entry.
  enum LauncherType {
    // Default for deserialization when an unexpected value is encountered.
    // Usually Indicates to the client that the server has a new reason and
    // needs the proto file updated.
    LAUNCHER_TYPE_UNKNOWN = 0;

    // Indicates where the Chrome Browser (Ash or Lacross) should be placed.
    // Note: this may be in a folder (see below).
    LAUNCHER_TYPE_CHROME = 1;

    // An App with the `package_id` should be placed in this position.
    // Note: this may be in a folder (see below).
    LAUNCHER_TYPE_APP = 2;

    // All other apps not explicitly listed should be installed in this
    // position in the order they are installed (ie. doesn't matter).
    // Note: this may be in a folder (see below).
    LAUNCHER_TYPE_OTHER = 3;

    // Indicates the position of the OEM folder which should be named with the
    // localised string in `folder_name`. Preloads marked "INSTALL_REASON_OEM"
    // should be placed in this folder in the order they install (ie. doesn't
    // matter).
    LAUNCHER_TYPE_FOLDER_OEM = 4;

    // Indicates an arbitrary folder should be created in this position named
    // with the string in `folder_name`. This will have a child configuration
    // which can only contain Apps (ie. no nested folders).
    LAUNCHER_TYPE_FOLDER = 5;
  }

  // Configuration defining the order of items pinned in the Launcher.
  message LauncherConfig {
    // Indicates what type of entry this is in the config (see above).
    optional LauncherType type = 1;

    // The order of the entries in this config. Sort by this value and then
    // process in ascending order.
    optional uint32 order = 2;

    // An optional feature flag. If specified, evaluate the flag and ignore
    // this entry if the feature is not enabled.
    optional string feature_flag = 3;

    // The identifier for the app for this slot (usually one). If more than one
    // is specified, evaluate the entries in order and place the first app
    // detected on the device in this slot. Ignore the remaining entries.
    repeated string package_id = 4;

    // For LAUNCHER_TYPE_FOLDER_OEM and LAUNCHER_TYPE_FOLDER, the localised name
    // to use for the folder.
    optional string folder_name = 5;

    // For LAUNCHER_TYPE_FOLDER the nested configuration controlling the
    // placement of apps within the folder.
    // Note: this is not recursive (ie. only valid for 1 level down).
    // Install the child apps in this configuration in the order specified.
    repeated LauncherConfig child_config = 6;
  }
}