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

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

Issue 2958333002: [Payments] Implement web payment app manifest (Closed)
Patch Set: fix tests and add comments Created 3 years, 6 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..b680bf9d12722e75057c13bb5d59a849ea59fb4e 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,19 @@ 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 app's manifest. The alternative value for the payment
+ // app will be used 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,
+ "Fetch payment app's info (manifest or the "
+ "field in the manifest) failed."));
please use gerrit instead 2017/06/30 15:43:30 A couple of comments: 1) Payment app is not the t
gogerald1 2017/06/30 16:25:09 Done.
+ 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