Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp

Issue 2958333002: [Payments] Implement web payment app manifest (Closed)
Patch Set: rename and comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp b/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
index 2da969b6564dcf4671b54b3554536e00ca35e578..003d89debfdbff268d782ba5a37759cfd2f8160c 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
@@ -11,6 +11,7 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/V8BindingForCore.h"
#include "core/dom/DOMException.h"
+#include "core/inspector/ConsoleMessage.h"
#include "modules/payments/PaymentInstrument.h"
#include "modules/payments/PaymentManager.h"
#include "platform/wtf/Vector.h"
@@ -46,6 +47,21 @@ bool rejectError(ScriptPromiseResolver* resolver,
resolver->Reject(DOMException::Create(
kNotFoundError, "Fetch or decode instrument icon failed"));
return true;
+ case payments::mojom::blink::PaymentHandlerStatus::
+ FETCH_PAYMENT_APP_INFO_FAILED:
+ // FETCH_PAYMENT_APP_INFO_FAILED indicates everything works well except
+ // fetching payment handler's name and/or icon from its web app manifest.
+ // The origin or name will be used to label this payment handler in
+ // UI in this case, so only show warnning message instead of reject the
+ // promise.
+ ExecutionContext* context =
+ ExecutionContext::From(resolver->GetScriptState());
+ context->AddConsoleMessage(ConsoleMessage::Create(
+ kJSMessageSource, kWarningMessageLevel,
+ "Unable to fetch payment handler's name and icon from its web app "
+ "manifest. User may not recognize this payment handler in UI, "
+ "because it will be labeled only by its origin."));
+ return false;
}
NOTREACHED();
return false;
« no previous file with comments | « content/test/data/payments/payment_app_invocation.html ('k') | third_party/WebKit/Source/modules/payments/PaymentManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698