| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
|
| index 896205dda70f5c91f6f781e7e790f7566b25d163..c7df45cb8a091c1844cc476eafb69745e343559c 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
|
| @@ -35,6 +35,7 @@ import android.widget.TextView;
|
| import org.chromium.base.ApiCompatibilityUtils;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.chrome.R;
|
| +import org.chromium.chrome.browser.payments.ui.PaymentOption.OptionSectionFocusChangedDelegate;
|
| import org.chromium.chrome.browser.widget.DualControlLayout;
|
| import org.chromium.chrome.browser.widget.TintedDrawable;
|
|
|
| @@ -1076,6 +1077,8 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| /** Indicates whether the summary should be a single line. */
|
| private boolean mSummaryInSingleLine = false;
|
|
|
| + private OptionSectionFocusChangedDelegate mFocusChangedDelegate;
|
| +
|
| /**
|
| * Constructs an OptionSection.
|
| *
|
| @@ -1092,6 +1095,16 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| setSummaryText(null, null);
|
| }
|
|
|
| + /**
|
| + * Registers the delegate to be notified when this OptionSection gains or loses focus.
|
| + *
|
| + * @param delegate The delegate to notify.
|
| + */
|
| + public void setOptionSectionFocusChangedDelegate(
|
| + OptionSectionFocusChangedDelegate delegate) {
|
| + mFocusChangedDelegate = delegate;
|
| + }
|
| +
|
| @Override
|
| public void handleClick(View v) {
|
| for (int i = 0; i < mOptionRows.size(); i++) {
|
| @@ -1127,6 +1140,12 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| return;
|
| }
|
|
|
| + // Notify the observer that the focus is going to change.
|
| + if (mFocusChangedDelegate != null) {
|
| + mFocusChangedDelegate.onOptionSectionFocusChanged(
|
| + mSectionInformation.getDataType(), shouldFocus);
|
| + }
|
| +
|
| super.focusSection(shouldFocus);
|
| }
|
|
|
|
|