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

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

Issue 2955963002: Update Chrome Upstream flow to reflect new UI mocks (Closed)
Patch Set: Prevent AddNewUiFlagStateToRequestIfExperimentOn test from running on Android Created 3 years, 4 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.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 f028e3023b91352cace1eff48532a67d8f4f2a4c..80108c4c8f835310fbea6ea0b0179eaa197b2962 100644
--- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
+++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
+#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/autofill_constants.h"
@@ -108,6 +109,7 @@ void SaveCardBubbleControllerImpl::HideBubble() {
save_card_bubble_view_->Hide();
save_card_bubble_view_ = nullptr;
}
+ show_upload_confirm_title_ = false;
}
void SaveCardBubbleControllerImpl::ReshowBubble() {
@@ -135,15 +137,30 @@ SaveCardBubbleView* SaveCardBubbleControllerImpl::save_card_bubble_view()
}
base::string16 SaveCardBubbleControllerImpl::GetWindowTitle() const {
- return l10n_util::GetStringUTF16(
- is_uploading_ ? IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_TO_CLOUD
- : IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_LOCAL);
+ if (is_uploading_) {
+ if (show_upload_confirm_title_) {
+ return l10n_util::GetStringFUTF16(
+ IDS_AUTOFILL_SAVE_CARD_PROMPT_ENTER_CVC_TITLE,
+ card_.NetworkAndLastFourDigits());
+ } else if (IsAutofillUpstreamShowNewUiExperimentEnabled()) {
+ return l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_TO_CLOUD_V2);
+ }
+ return l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_TO_CLOUD);
+ }
+ return l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_LOCAL);
}
base::string16 SaveCardBubbleControllerImpl::GetExplanatoryMessage() const {
- return is_uploading_ ? l10n_util::GetStringUTF16(
- IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION)
- : base::string16();
+ if (is_uploading_) {
+ return IsAutofillUpstreamShowNewUiExperimentEnabled()
+ ? l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_V2)
+ : l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION);
+ }
+ return base::string16();
}
const CreditCard SaveCardBubbleControllerImpl::GetCard() const {
@@ -215,6 +232,7 @@ void SaveCardBubbleControllerImpl::OnLegalMessageLinkClicked(const GURL& url) {
void SaveCardBubbleControllerImpl::OnBubbleClosed() {
save_card_bubble_view_ = nullptr;
UpdateIcon();
+ show_upload_confirm_title_ = false;
}
const LegalMessageLines& SaveCardBubbleControllerImpl::GetLegalMessageLines()
@@ -222,6 +240,11 @@ const LegalMessageLines& SaveCardBubbleControllerImpl::GetLegalMessageLines()
return legal_message_lines_;
}
+void SaveCardBubbleControllerImpl::SetShowUploadConfirmTitle(
+ bool show_upload_confirm_title) {
+ show_upload_confirm_title_ = show_upload_confirm_title;
+}
+
bool SaveCardBubbleControllerImpl::InputCvcIsValid(
const base::string16& input_text) const {
base::string16 trimmed_text;

Powered by Google App Engine
This is Rietveld 408576698