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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AndroidPaymentAppPreference.java

Issue 2647573005: [Payments] Allow users enable and disable Android payment apps in payment request (Closed)
Patch Set: rename Created 3 years, 11 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/android/java/src/org/chromium/chrome/browser/preferences/autofill/AndroidPaymentAppPreference.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AndroidPaymentAppPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AndroidPaymentAppPreference.java
new file mode 100644
index 0000000000000000000000000000000000000000..39e71a1b58a7fa1b91e3490cdf49dab399c998c3
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AndroidPaymentAppPreference.java
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.preferences.autofill;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.preferences.ChromeSwitchPreference;
+
+/** ChromeSwitchPreference with fixed icon size for Android payment apps. */
+public class AndroidPaymentAppPreference extends ChromeSwitchPreference {
+ public AndroidPaymentAppPreference(Context context) {
+ super(context, null);
+ }
+
+ @Override
+ protected View onCreateView(ViewGroup parent) {
+ View view = super.onCreateView(parent);
+
+ int iconSize =
+ getContext().getResources().getDimensionPixelSize(R.dimen.payments_favicon_size);
+ View iconView = view.findViewById(android.R.id.icon);
+ ViewGroup.LayoutParams layoutParams = iconView.getLayoutParams();
+ layoutParams.width = iconSize;
+ layoutParams.height = iconSize;
+ iconView.setLayoutParams(layoutParams);
+
+ return view;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698