| 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..a8ecda78d5d419c8a0f2725082bc8f0a41b59b80 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
|
| @@ -833,6 +833,19 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| private boolean mCanAddItems = true;
|
|
|
| /**
|
| + * Observer to be notified when the OptionSection changes focus state.
|
| + */
|
| + public interface FocusChangedObserver {
|
| + /*
|
| + * Called when the OptionSection view gets or loses focus.
|
| + *
|
| + * @param dataType The type of the data contained in the section.
|
| + * @param willFocus Whether the section is getting the focus.
|
| + */
|
| + void onFocusChanged(@PaymentRequestUI.DataType int dataType, boolean willFocus);
|
| + }
|
| +
|
| + /**
|
| * Displays a row representing either a selectable option or some flavor text.
|
| *
|
| * + The "button" is on the left and shows either an icon or a radio button to represent th
|
| @@ -1076,6 +1089,8 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| /** Indicates whether the summary should be a single line. */
|
| private boolean mSummaryInSingleLine = false;
|
|
|
| + private FocusChangedObserver mFocusChangedObserver;
|
| +
|
| /**
|
| * Constructs an OptionSection.
|
| *
|
| @@ -1092,6 +1107,15 @@ 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 setOptionSectionFocusChangedObserver(FocusChangedObserver observer) {
|
| + mFocusChangedObserver = observer;
|
| + }
|
| +
|
| @Override
|
| public void handleClick(View v) {
|
| for (int i = 0; i < mOptionRows.size(); i++) {
|
| @@ -1127,6 +1151,12 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
|
| return;
|
| }
|
|
|
| + // Notify the observer that the focus is going to change.
|
| + if (mFocusChangedObserver != null) {
|
| + mFocusChangedObserver.onFocusChanged(
|
| + mSectionInformation.getDataType(), shouldFocus);
|
| + }
|
| +
|
| super.focusSection(shouldFocus);
|
| }
|
|
|
|
|