OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
6 | 6 |
7 import android.content.Intent; | 7 import android.content.Intent; |
8 import android.content.pm.ActivityInfo; | 8 import android.content.pm.ActivityInfo; |
9 import android.content.pm.ResolveInfo; | 9 import android.content.pm.ResolveInfo; |
10 import android.content.res.Resources; | 10 import android.content.res.Resources; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 .findAndroidPaymentApps(); | 107 .findAndroidPaymentApps(); |
108 } | 108 } |
109 | 109 |
110 private AndroidPaymentAppFinder(WebContents webContents, Set<String> methods , | 110 private AndroidPaymentAppFinder(WebContents webContents, Set<String> methods , |
111 PaymentManifestDownloader downloader, PaymentManifestParser parser, | 111 PaymentManifestDownloader downloader, PaymentManifestParser parser, |
112 PackageManagerDelegate packageManagerDelegate, PaymentAppCreatedCall back callback) { | 112 PackageManagerDelegate packageManagerDelegate, PaymentAppCreatedCall back callback) { |
113 mWebContents = webContents; | 113 mWebContents = webContents; |
114 | 114 |
115 // For non-URI payment method names, only names published by W3C should be supported. | 115 // For non-URI payment method names, only names published by W3C should be supported. |
116 Set<String> supportedNonUriPaymentMethods = new HashSet<>(); | 116 Set<String> supportedNonUriPaymentMethods = new HashSet<>(); |
117 // https://w3c.github.io/webpayments-methods-card/ | |
117 supportedNonUriPaymentMethods.add(BASIC_CARD_PAYMENT_METHOD); | 118 supportedNonUriPaymentMethods.add(BASIC_CARD_PAYMENT_METHOD); |
gogerald1
2017/04/27 14:35:33
use "basic-card" here as well and remove BASIC_CAR
please use gerrit instead
2017/04/27 14:41:24
Done.
| |
119 // https://w3c.github.io/webpayments/proposals/interledger-payment-metho d.html | |
120 supportedNonUriPaymentMethods.add("interledger"); | |
118 | 121 |
119 mNonUriPaymentMethods = new HashSet<>(); | 122 mNonUriPaymentMethods = new HashSet<>(); |
120 mUriPaymentMethods = new HashSet<>(); | 123 mUriPaymentMethods = new HashSet<>(); |
121 for (String method : methods) { | 124 for (String method : methods) { |
122 assert !TextUtils.isEmpty(method); | 125 assert !TextUtils.isEmpty(method); |
123 if (supportedNonUriPaymentMethods.contains(method)) { | 126 if (supportedNonUriPaymentMethods.contains(method)) { |
124 mNonUriPaymentMethods.add(method); | 127 mNonUriPaymentMethods.add(method); |
125 } else if (method.startsWith(UrlConstants.HTTPS_URL_PREFIX)) { | 128 } else if (method.startsWith(UrlConstants.HTTPS_URL_PREFIX)) { |
126 URI uri; | 129 URI uri; |
127 try { | 130 try { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 } | 313 } |
311 } | 314 } |
312 | 315 |
313 for (Map.Entry<String, AndroidPaymentApp> entry : mResult.entrySet()) { | 316 for (Map.Entry<String, AndroidPaymentApp> entry : mResult.entrySet()) { |
314 mCallback.onPaymentAppCreated(entry.getValue()); | 317 mCallback.onPaymentAppCreated(entry.getValue()); |
315 } | 318 } |
316 | 319 |
317 mCallback.onAllPaymentAppsCreated(); | 320 mCallback.onAllPaymentAppsCreated(); |
318 } | 321 } |
319 } | 322 } |
OLD | NEW |