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

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

Issue 1396923003: Autofill: Replace "save credit card" infobar with a bubble (Views only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/chrome_autofill_client.cc
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index 393637191d77aac6ef469f0f09ffbaeb5cf8d03a..f8b43d34ea83f4245a9d78c6a930d727d373b9fe 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -57,6 +57,7 @@ ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents)
user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()),
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->IsOffTheRecord()),
+ save_card_bubble_controller_(web_contents),
last_rfh_to_rac_(nullptr) {
DCHECK(web_contents);
@@ -153,9 +154,28 @@ void ChromeAutofillClient::OnUnmaskVerificationResult(GetRealPanResult result) {
void ChromeAutofillClient::ConfirmSaveCreditCard(
const base::Closure& save_card_callback) {
+// TODO(bondd): Implement save card bubble for OS_MACOSX.
+#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN)
+ Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
+ if (browser)
+ save_card_bubble_controller_.ShowBubble(save_card_callback);
+#else
AutofillCCInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents()), this,
save_card_callback);
+#endif
+}
+
+void ChromeAutofillClient::ShowSaveCreditCardBubble() {
+ save_card_bubble_controller_.ReshowBubble();
+}
+
+bool ChromeAutofillClient::WantSaveCreditCardIconVisible() {
+ return save_card_bubble_controller_.WantIconVisible();
+}
+
+bool ChromeAutofillClient::WantSaveCreditCardIconToggled() {
+ return save_card_bubble_controller_.WantIconToggled();
}
bool ChromeAutofillClient::HasCreditCardScanFeature() {

Powered by Google App Engine
This is Rietveld 408576698