Commit c3b83976 authored by estade's avatar estade Committed by Commit bot

Fix crash when user closes card unmasking dialog after verification

success

BUG=none

Review URL: https://codereview.chromium.org/1019143003

Cr-Commit-Position: refs/heads/master@{#321453}
parent 27532a00
...@@ -58,7 +58,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -58,7 +58,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
error_label_(nullptr), error_label_(nullptr),
storage_checkbox_(nullptr), storage_checkbox_(nullptr),
progress_overlay_(nullptr), progress_overlay_(nullptr),
progress_label_(nullptr) {} progress_label_(nullptr),
weak_ptr_factory_(this) {}
~CardUnmaskPromptViews() override { ~CardUnmaskPromptViews() override {
if (controller_) if (controller_)
...@@ -90,7 +91,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -90,7 +91,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_SUCCESS)); IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_SUCCESS));
base::MessageLoop::current()->PostDelayedTask( base::MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&CardUnmaskPromptViews::ClosePrompt, FROM_HERE, base::Bind(&CardUnmaskPromptViews::ClosePrompt,
base::Unretained(this)), weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(1)); base::TimeDelta::FromSeconds(1));
} else { } else {
// TODO(estade): it's somewhat jarring when the error comes back too // TODO(estade): it's somewhat jarring when the error comes back too
...@@ -419,6 +420,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -419,6 +420,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
views::View* progress_overlay_; views::View* progress_overlay_;
views::Label* progress_label_; views::Label* progress_label_;
base::WeakPtrFactory<CardUnmaskPromptViews> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews); DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews);
}; };
......
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