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

Unified Diff: chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc

Issue 2862933002: [autofill] Avoid duplicate instances of the SaveCardBubble. (Closed)
Patch Set: fix typo Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
index 186d083f1ef04e85451a597b5c20d4264b4957a3..b963de56055ea56191965c39a351f6e6672782af 100644
--- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
+++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
@@ -50,6 +50,10 @@ SaveCardBubbleControllerImpl::~SaveCardBubbleControllerImpl() {
void SaveCardBubbleControllerImpl::ShowBubbleForLocalSave(
const CreditCard& card,
const base::Closure& save_card_callback) {
+ // Don't show the bubble if it's already visible.
+ if (save_card_bubble_view_)
+ return;
+
is_uploading_ = false;
is_reshow_ = false;
should_cvc_be_requested_ = false;
@@ -71,6 +75,10 @@ void SaveCardBubbleControllerImpl::ShowBubbleForUpload(
std::unique_ptr<base::DictionaryValue> legal_message,
bool should_cvc_be_requested,
const base::Closure& save_card_callback) {
+ // Don't show the bubble if it's already visible.
+ if (save_card_bubble_view_)
+ return;
+
is_uploading_ = true;
is_reshow_ = false;
should_cvc_be_requested_ = should_cvc_be_requested;
@@ -102,6 +110,10 @@ void SaveCardBubbleControllerImpl::HideBubble() {
}
void SaveCardBubbleControllerImpl::ReshowBubble() {
+ // Don't show the bubble if it's already visible.
+ if (save_card_bubble_view_)
+ return;
+
is_reshow_ = true;
AutofillMetrics::LogSaveCardPromptMetric(
AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_,
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698