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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java

Issue 2526943003: [Payments] Remove country from shipping label in bottom and fullsheet. (Closed)
Patch Set: Moved assertion Created 4 years, 1 month 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698