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

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

Issue 2789843004: [Payments] Upload card UI now has a CVC prompt (Closed)
Patch Set: Created 3 years, 9 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
Index: chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
diff --git a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
index d5268d028abf9f892981b8027e21f5a163bfdccd..4488c8e4a3a54ead6b9718abf2e6150fa0f09b56 100644
--- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
+++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
@@ -9,8 +9,8 @@
#include "base/macros.h"
#include "base/timer/elapsed_timer.h"
-#include "chrome/browser/ui/autofill/save_card_bubble_controller.h"
#include "components/autofill/core/browser/credit_card.h"
+#include "components/autofill/core/browser/ui/save_card_bubble_controller.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -32,8 +32,11 @@ class SaveCardBubbleControllerImpl
// Sets up the controller for upload and shows the bubble.
// |save_card_callback| will be invoked if and when the Save button is
// pressed. The contents of |legal_message| will be displayed in the bubble.
+ // A field requesting CVC will appear in the bubble if
+ // |upload_cvc_should_be_requested| is true.
void ShowBubbleForUpload(const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message,
+ const bool upload_cvc_should_be_requested,
jiahuiguo 2017/03/31 22:52:19 Don't need const here?
Jared Saul 2017/04/01 04:18:02 Done.
const base::Closure& save_card_callback);
void HideBubble();
@@ -49,6 +52,10 @@ class SaveCardBubbleControllerImpl
base::string16 GetWindowTitle() const override;
base::string16 GetExplanatoryMessage() const override;
const CreditCard GetCard() const override;
+ int GetCvcImageRid() const override;
+ bool ShouldRequestCvcFromUser() const override;
+ void SetUserProvidedCvc(const base::string16& cvc) override;
+ const base::string16 GetUserProvidedCvc() const override;
csashi 2017/03/31 21:48:15 Don't need const base::string16.
Jared Saul 2017/04/01 04:18:02 Done.
void OnSaveButton() override;
void OnCancelButton() override;
void OnLearnMoreClicked() override;
@@ -57,6 +64,9 @@ class SaveCardBubbleControllerImpl
const LegalMessageLines& GetLegalMessageLines() const override;
+ // Used to check if an entered CVC value is a valid CVC for the current card.
csashi 2017/03/31 21:48:15 I assume this is a simple check (# digits or some
Jared Saul 2017/04/01 04:18:02 Done.
+ bool InputCvcIsValid(const base::string16& input_text) const override;
csashi 2017/03/31 21:48:15 IsValidCVC ?
Shanfeng 2017/03/31 22:58:45 +1
Jared Saul 2017/04/01 04:18:02 InputCvcIsValid() is already a function in card_un
+
protected:
explicit SaveCardBubbleControllerImpl(content::WebContents* web_contents);
~SaveCardBubbleControllerImpl() override;
@@ -93,6 +103,12 @@ class SaveCardBubbleControllerImpl
// Whether ReshowBubble() has been called since ShowBubbleFor*() was called.
bool is_reshow_;
+ // Whether the upload save version of the UI should ask the user for CVC.
+ bool upload_cvc_should_be_requested_;
+
+ // The value of the CVC entered by the user (if it was requested).
+ base::string16 cvc_entered_by_user_;
Shanfeng 2017/03/31 22:58:45 Sync the name with Getter and Setter.
Jared Saul 2017/04/01 04:18:02 Done.
+
// Contains the details of the card that will be saved if the user accepts.
CreditCard card_;

Powered by Google App Engine
This is Rietveld 408576698