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

Unified Diff: chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc

Issue 910043002: Add checkbox to card unmasking prompt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix dbg compile Created 5 years, 10 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/views/autofill/card_unmask_prompt_views.cc
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
index 7de5fb4b896537640212abb0721c87117d09fcbc..9473f82a42d6de018e8dbccd808de8f146a23dde 100644
--- a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
+++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
@@ -13,6 +13,7 @@
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/combobox/combobox_listener.h"
#include "ui/views/controls/image_view.h"
@@ -37,7 +38,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
cvc_input_(nullptr),
month_input_(nullptr),
year_input_(nullptr),
- message_label_(nullptr) {}
+ message_label_(nullptr),
+ storage_checkbox_(nullptr) {}
~CardUnmaskPromptViews() override {
if (controller_)
@@ -158,7 +160,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
: base::string16(),
year_input_
? year_combobox_model_.GetItemAt(year_input_->selected_index())
- : base::string16());
+ : base::string16(),
+ storage_checkbox_ ? storage_checkbox_->checked() : false);
return false;
}
@@ -218,6 +221,11 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
message_label_ = new views::Label();
input_row->AddChildView(message_label_);
message_label_->SetVisible(false);
+
+ storage_checkbox_ = new views::Checkbox(l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_CARD_UNMASK_PROMPT_STORAGE_CHECKBOX));
+ storage_checkbox_->SetChecked(controller_->GetStoreLocallyStartState());
+ AddChildView(storage_checkbox_);
}
void ClosePrompt() { GetWidget()->Close(); }
@@ -237,6 +245,8 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
// as well as a better error message.
views::Label* message_label_;
+ views::Checkbox* storage_checkbox_;
+
DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViews);
};
« no previous file with comments | « chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc ('k') | components/autofill/core/browser/autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698