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

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

Issue 2870013003: [autofill] Avoid duplicate instances of the SaveCardBubble. (Closed)
Patch Set: 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 78ad6a87fb6a953410398313be68585b138f2c21..fa59df070b1b11a3bcd26e15a2b9995c37aad2cc 100644
--- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
+++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
@@ -47,6 +47,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;
@@ -66,6 +70,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;
@@ -93,6 +101,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