File: native_error_strings.h

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 (311 lines) | stat: -rw-r--r-- 13,216 bytes parent folder | download | duplicates (4)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_PAYMENTS_CORE_NATIVE_ERROR_STRINGS_H_
#define COMPONENTS_PAYMENTS_CORE_NATIVE_ERROR_STRINGS_H_

namespace payments {
namespace errors {

// These strings are referenced only from C++.

// Mojo call PaymentRequest::Init() must precede PaymentRequest::Abort().
extern const char kCannotAbortWithoutInit[];

// Mojo call PaymentRequest::Show() must precede PaymentRequest::Abort().
extern const char kCannotAbortWithoutShow[];

// Mojo call PaymentRequest::Init() must precede
// PaymentRequest::CanMakePayment().
extern const char kCannotCallCanMakePaymentWithoutInit[];

// Mojo call PaymentRequest::Init() must precede
// PaymentRequest::HasEnrolledInstrument().
extern const char kCannotCallHasEnrolledInstrumentWithoutInit[];

// Mojo call PaymentRequest::Init() must precede PaymentRequest::Complete().
extern const char kCannotCompleteWithoutInit[];

// Mojo call PaymentRequest::Show() must precede PaymentRequest::Complete().
extern const char kCannotCompleteWithoutShow[];

// Used when "serviceworker"."scope" string A in web app manifest B is not a
// valid URL and cannot be resolved as a relative URL either. This format should
// be used with base::ReplaceStringPlaceholders(fmt, {A, B}, nullptr).
extern const char kCannotResolveServiceWorkerScope[];

// Used when "serviceworker"."src" string A in web app manifest B is not a valid
// URL and cannot be resolved as a relative URL either. This format should be
// used with base::ReplaceStringPlaceholders(fmt, {A, B}, nullptr).
extern const char kCannotResolveServiceWorkerUrl[];

// Mojo call PaymentRequest::Init() must precede PaymentRequest::Retry().
extern const char kCannotRetryWithoutInit[];

// Mojo call PaymentRequest::Show() must precede PaymentRequest::Retry().
extern const char kCannotRetryWithoutShow[];

// Used when a payment method A has a cross-origin "Link:
// rel=payment-method-manifest" to the manifest B. This format should be used
// with base::ReplaceStringPlaceholders(fmt, {B, A}, nullptr).
extern const char kCrossOriginPaymentMethodManifestNotAllowed[];

// The URL A in web app manifest B's "serviceworker"."scope" must be of the same
// origin as the web app manifest itself. This format should be used with
// base::ReplaceStringPlaceholders(fmt, {A, B}, nullptr).
extern const char kCrossOriginServiceWorkerScopeNotAllowed[];

// The URL A in web app manifest B's "serviceworker"."src" must be of the same
// origin as the web app manifest itself. This format should be used with
// base::ReplaceStringPlaceholders(fmt, {A, B}, nullptr).
extern const char kCrossOriginServiceWorkerUrlNotAllowed[];

// The "default_applications" list on origin A is not allowed to contain a URL
// from origin B. This format should be used with
// base::ReplaceStringPlaceholders(format, {B, A}, nullptr).
extern const char kCrossOriginWebAppManifestNotAllowed[];

// The format for a detailed message about invalid SSL certificate. This format
// should be used with base::ReplaceChars() function, where "$" is the character
// to replace.
extern const char kDetailedInvalidSslCertificateMessageFormat[];

// Used for HTTP redirects that are prohibited for payment method manifests.
// This format should be used with base::ReplaceStringPlaceholders(fmt,
// {http_code, http_code_phrase, original_url}, nullptr).
extern const char kHttpStatusCodeNotAllowed[];

// The "default_applications" list should contain exactly one URL for JIT
// install feature to work.
extern const char kInstallingMultipleDefaultAppsNotSupported[];

// PaymentRequest::Init() is called when the initiating RenderFrameHost no
// longer exists.
extern const char kInvalidInitiatorFrame[];

// Used to let the web developer know about an invalid payment manifest URL A.
// This format should be used with base::ReplaceStringPlaceholders(fmt, {A},
// nullptr).
extern const char kInvalidManifestUrl[];

// Web app manifest contains an empty or non-UTF8 service worker scope.
extern const char kInvalidServiceWorkerScope[];

// Web app manifest contains an empty or non-UTF8 service worker URL.
extern const char kInvalidServiceWorkerUrl[];

// Chrome refuses to provide any payment information to a website with an
// invalid SSL certificate.
extern const char kInvalidSslCertificate[];

// The downloaded web app icon should draw something for JIT install feature to
// work.
extern const char kInvalidWebAppIcon[];

// The format for the message about multiple payment methods that are not
// supported. This format should be used with base::ReplaceChars() function,
// where "$" is the character to replace.
extern const char kMultiplePaymentMethodsNotSupportedFormat[];

// Payment handler did not respond to the "paymentrequest" event.
extern const char kNoResponseToPaymentEvent[];

// Used when PaymentRequest::Init() has not been called, but should have been.
extern const char kNotInitialized[];

// Used when PaymentRequest::Show() has not been called, but should have been.
extern const char kNotShown[];

// Used for errors about cross-site redirects from A to B. This format should be
// used with base::ReplaceStringPlaceholders(fmt, {A, B}, nullptr).
extern const char kPaymentManifestCrossSiteRedirectNotAllowed[];

// Used when downloading payment manifest URL A has failed. This format should
// be used with base::ReplaceStringPlaceholders(fmt, {A}, nullptr).
extern const char kPaymentManifestDownloadFailed[];

// Used when downloading payment manifest URL A has failed because of network
// error B. This format should be used with
// base::ReplaceStringPlaceholders(
//     fmt, {A, net::ErrorToShortString(B), base::NumberToString(B)}, nullptr).
extern const char kPaymentManifestDownloadFailedWithNetworkError[];

// Used when downloading payment manifest URL A has failed because of HTTP
// status code B. This format should be used with
// base::ReplaceStringPlaceholders(
//     fmt, {A, base::NumberToString(B), net::GetHttpReasonPhrase(B)}, nullptr).
extern const char kPaymentManifestDownloadFailedWithHttpStatusCode[];

// Used when Content Security Policy (CSP) denied downloading payment manifest
// URL A. This format should be used with base::ReplaceStringPlaceholders(fmt,
// {A}, nullptr).
extern const char kPaymentManifestCSPDenied[];

// Payment handler passed a non-object field "details" in response to the
// "paymentrequest" event.
extern const char kPaymentDetailsNotObject[];

// Payment handler passed a non-stringifiable field "details" in response to the
// "paymentrequest" event.
extern const char kPaymentDetailsStringifyError[];

// Used when the browser failed to fire the "paymentrequest" event without any
// actionable corrective action from the web developer.
extern const char kPaymentEventBrowserError[];

// Service worker timed out or stopped for some reason or was killed before the
// payment handler could respond to the "paymentrequest" event.
extern const char kPaymentEventServiceWorkerError[];

// Service worker timed out while responding to "paymentrequest" event.
extern const char kPaymentEventTimeout[];

// Payment handler navigated to a page with insecure context, invalid SSL, or
// malicious content.
extern const char kPaymentHandlerInsecureNavigation[];

// Payment handler installation has failed.
extern const char kPaymentHandlerInstallFailed[];

// The payment handler is closed because the Android activity is destroyed.
extern const char kPaymentHandlerActivityDied[];

// The payment handler fails to load the page.
extern const char kPaymentHandlerFailToLoadMainFrame[];

// Payment handler encountered an internal error when handling the
// "paymentrequest" event.
extern const char kPaymentEventInternalError[];

// Payment handler rejected the promise passed into
// PaymentRequestEvent.respondWith() method.
extern const char kPaymentEventRejected[];

// Used when maximum number of redirects has been reached.
extern const char kReachedMaximumNumberOfRedirects[];

// The format for the message about a single payment method that is not
// supported. This format should be used with base::ReplaceChars() function,
// where "$" is the character to replace.
extern const char kSinglePaymentMethodNotSupportedFormat[];

// The payment handler rejected the promise passed into
// CanMakePaymentEvent.respondWith().
extern const char kCanMakePaymentEventRejected[];

// The payment handler timed out responding to "canmakepayment" event.
extern const char kCanMakePaymentEventTimeout[];

// The payment handler did not respond to the "canmakepayment" event.
extern const char kCanMakePaymentEventNoResponse[];

// The payment handler called CanMakePaymentEvent.respondWith(value) with a
// non-boolean value.
extern const char kCanMakePaymentEventBooleanConversionError[];

// Browser encountered an error when firing the "canmakepayment" event.
extern const char kCanMakePaymentEventBrowserError[];

// The payment handler threw a JavaScript exception while handling the
// "canmakepayment" event.
extern const char kCanMakePaymentEventInternalError[];

// Browser does not fire the "canmakepayment" event if the payment handler does
// not support any URL-based payment methods.
extern const char kCanMakePaymentEventNoUrlBasedPaymentMethods[];

// Browser does not fire the "canmakepayment" event for just-in-time installable
// payment handlers.
extern const char kCanMakePaymentEventNotInstalled[];

// Browser fires the "canmakepayment" event only for explicitly verified payment
// methods, i.e., not when "supportedOrigins": "*".
extern const char kCanMakePaymentEventNoExplicitlyVerifiedMethods[];

// A message about unsupported payment method.
extern const char kGenericPaymentMethodNotSupportedMessage[];

// Used for errors downloading the payment method manifest. This format should
// be used with base::ReplaceStringPlaceholders(fmt, {A}, nullptr).
extern const char kNoLinkHeader[];

// Used for errors downloading the payment method manifest. This format should
// be used with base::ReplaceStringPlaceholders(fmt, {A}, nullptr).
extern const char kNoContentAndNoLinkHeader[];

// Used when the downloaded payment manifest A is empty. This format should be
// used with base::ReplaceStringPlaceholders(fmt, {A}, nullptr).
extern const char kNoContentInPaymentManifest[];

// Used when it's impossible to invoke Android payment apps, e.g., when ARC is
// disabled on Chrome OS.
extern const char kUnableToInvokeAndroidPaymentApps[];

// Used when the user has closed the payment app. For example, An Android app
// indicates this by returning Activity.RESULT_CANCELED.
extern const char kUserClosedPaymentApp[];

// Used when an Android app declares more than one IS_READY_TO_PAY service.
extern const char kMoreThanOneService[];

// Used when no credential IDs are specified for the
// "secure-payment-confirmation" method.
extern const char kCredentialIdsRequired[];

// Used when the timeout specified for the "secure-payment-confirmation" method
// is too long.
extern const char kTimeoutTooLong[];

// Used when the challenge field was not specified for the
// "secure-payment-confirmation" method.
extern const char kChallengeRequired[];

// Used when the instrument field was not specified for the
// "secure-payment-confirmation" method.
extern const char kInstrumentRequired[];

// Used when the instrument.displayName field was not specified for the
// "secure-payment-confirmation" method.
extern const char kInstrumentDisplayNameRequired[];

// Used when the instrument.icon field was not specified or was not a valid URL
// in the "secure-payment-confirmation" method.
extern const char kValidInstrumentIconRequired[];

// Used when the icon that was either downloaded or read from user profile is
// not valid.
extern const char kInvalidIcon[];

// Used when the rpId field was not specified for the
// "secure-payment-confirmation" method.
extern const char kRpIdRequired[];

// Used when neither of the payeeOrigin or payeeName fields were specified for
// the "secure-payment-confirmation" method.
extern const char kPayeeOriginOrPayeeNameRequired[];

// Used when the payeeOrigin field was specified but was non-https for the
// "secure-payment-confirmation" method.
extern const char kPayeeOriginMustBeHttps[];

// Used when the networkInfo field was specified but the networkInfo.name field
// was empty for the "secure-payment-confirmation" method.
extern const char kNetworkNameRequired[];

// Used when the networkInfo field was specified but the networkInfo.icon field
// was not a valid URL in the "secure-payment-confirmation" method.
extern const char kValidNetworkIconRequired[];

// Used when the issuerInfo field was specified but the issuerInfo.name field
// was empty for the "secure-payment-confirmation" method.
extern const char kIssuerNameRequired[];

// Used when the issuerInfo field was specified but the issuerInfo.icon field
// was not a valid URL in the "secure-payment-confirmation" method.
extern const char kValidIssuerIconRequired[];

}  // namespace errors
}  // namespace payments

#endif  // COMPONENTS_PAYMENTS_CORE_NATIVE_ERROR_STRINGS_H_