Commit 2e77c18e authored by Daniel Park's avatar Daniel Park Committed by Commit Bot

[Chrome Home Survey] Prevents double clicking on an infobar

Prevents double tapping of a survey info bar to prevent
  any double click issues e.g. this crash

Bug: 791076
Change-Id: Ifcb8961beaf4bcd1353eb1a121f51e2249de3809
Reviewed-on: https://chromium-review.googlesource.com/804751Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Daniel Park <danielpark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521447}
parent 8485e499
...@@ -91,13 +91,18 @@ public class SurveyInfoBar extends InfoBar { ...@@ -91,13 +91,18 @@ public class SurveyInfoBar extends InfoBar {
}); });
NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan() { NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan() {
/** Prevent double clicking on the text span. */
private boolean mClicked;
@Override @Override
public void onClick(View widget) { public void onClick(View widget) {
if (mClicked) return;
mDelegate.onSurveyTriggered(); mDelegate.onSurveyTriggered();
SurveyController.getInstance().showSurveyIfAvailable( SurveyController.getInstance().showSurveyIfAvailable(
tab.getActivity(), mSiteId, mShowAsBottomSheet, mDisplayLogoResId); tab.getActivity(), mSiteId, mShowAsBottomSheet, mDisplayLogoResId);
onCloseButtonClicked(); onCloseButtonClicked();
mClicked = true;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment