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

Unified Diff: chrome/browser/android/payments/service_worker_payment_app_bridge.cc

Issue 2887713002: PaymentHandler: Merge PaymentAppRequest and PaymentRequestEvent. (Closed)
Patch Set: rebase Created 3 years, 7 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: chrome/browser/android/payments/service_worker_payment_app_bridge.cc
diff --git a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
index cff84fca1216cc408a50c59e022c407a60244991..41bd33bfef2270b8d8255261a5f761439bd8fdee 100644
--- a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
+++ b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
@@ -85,23 +85,30 @@ static void GetAllPaymentApps(JNIEnv* env,
ScopedJavaGlobalRef<jobject>(env, jcallback)));
}
-static void InvokePaymentApp(JNIEnv* env,
- const JavaParamRef<jclass>& jcaller,
- const JavaParamRef<jobject>& jweb_contents,
- jlong registration_id,
- const JavaParamRef<jstring>& joption_id,
- const JavaParamRef<jstring>& jorigin,
- const JavaParamRef<jobjectArray>& jmethod_data,
- const JavaParamRef<jobject>& jtotal,
- const JavaParamRef<jobjectArray>& jmodifiers,
- const JavaParamRef<jobject>& jcallback) {
+static void InvokePaymentApp(
+ JNIEnv* env,
+ const JavaParamRef<jclass>& jcaller,
+ const JavaParamRef<jobject>& jweb_contents,
+ jlong registration_id,
+ const JavaParamRef<jstring>& jtop_level_origin,
+ const JavaParamRef<jstring>& jpayment_request_origin,
+ const JavaParamRef<jstring>& jpayment_request_id,
+ const JavaParamRef<jobjectArray>& jmethod_data,
+ const JavaParamRef<jobject>& jtotal,
+ const JavaParamRef<jobjectArray>& jmodifiers,
+ const JavaParamRef<jstring>& jinstrument_key,
+ const JavaParamRef<jobject>& jcallback) {
content::WebContents* web_contents =
content::WebContents::FromJavaWebContents(jweb_contents);
PaymentAppRequestPtr app_request = PaymentAppRequest::New();
- app_request->option_id = ConvertJavaStringToUTF8(env, joption_id);
- app_request->origin = GURL(ConvertJavaStringToUTF8(env, jorigin));
+ app_request->top_level_origin =
+ GURL(ConvertJavaStringToUTF8(env, jtop_level_origin));
+ app_request->payment_request_origin =
+ GURL(ConvertJavaStringToUTF8(env, jpayment_request_origin));
+ app_request->payment_request_id =
+ ConvertJavaStringToUTF8(env, jpayment_request_id);
for (jsize i = 0; i < env->GetArrayLength(jmethod_data); i++) {
ScopedJavaLocalRef<jobject> element(
@@ -169,6 +176,8 @@ static void InvokePaymentApp(JNIEnv* env,
app_request->modifiers.push_back(std::move(modifier));
}
+ app_request->instrument_key = ConvertJavaStringToUTF8(env, jinstrument_key);
+
content::PaymentAppProvider::GetInstance()->InvokePaymentApp(
web_contents->GetBrowserContext(), registration_id,
std::move(app_request),

Powered by Google App Engine
This is Rietveld 408576698