OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 controller->ShowBubbleForLocalSave(card, callback); | 199 controller->ShowBubbleForLocalSave(card, callback); |
200 #endif | 200 #endif |
201 } | 201 } |
202 | 202 |
203 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( | 203 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( |
204 const CreditCard& card, | 204 const CreditCard& card, |
205 std::unique_ptr<base::DictionaryValue> legal_message, | 205 std::unique_ptr<base::DictionaryValue> legal_message, |
206 bool should_cvc_be_requested, | 206 bool should_cvc_be_requested, |
207 const base::Closure& callback) { | 207 const base::Closure& callback) { |
208 #if defined(OS_ANDROID) | 208 #if defined(OS_ANDROID) |
209 InfoBarService::FromWebContents(web_contents()) | 209 std::unique_ptr<AutofillSaveCardInfoBarDelegateMobile> |
210 ->AddInfoBar(CreateSaveCardInfoBarMobile( | 210 save_card_info_bar_delegate_mobile = |
211 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( | 211 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( |
212 true, card, std::move(legal_message), callback, GetPrefs()))); | 212 true, card, std::move(legal_message), callback, GetPrefs()); |
| 213 if (save_card_info_bar_delegate_mobile->LegalMessagesParsedSuccessfully()) { |
| 214 InfoBarService::FromWebContents(web_contents()) |
| 215 ->AddInfoBar(CreateSaveCardInfoBarMobile( |
| 216 std::move(save_card_info_bar_delegate_mobile))); |
| 217 } |
213 #else | 218 #else |
214 // Do lazy initialization of SaveCardBubbleControllerImpl. | 219 // Do lazy initialization of SaveCardBubbleControllerImpl. |
215 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); | 220 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
216 autofill::SaveCardBubbleControllerImpl* controller = | 221 autofill::SaveCardBubbleControllerImpl* controller = |
217 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 222 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
218 controller->ShowBubbleForUpload(card, std::move(legal_message), | 223 controller->ShowBubbleForUpload(card, std::move(legal_message), |
219 should_cvc_be_requested, callback); | 224 should_cvc_be_requested, callback); |
220 #endif | 225 #endif |
221 } | 226 } |
222 | 227 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // directly. | 399 // directly. |
395 const GURL kSecurityIndicatorHelpCenterUrl( | 400 const GURL kSecurityIndicatorHelpCenterUrl( |
396 "https://support.google.com/chrome/?p=ui_security_indicator"); | 401 "https://support.google.com/chrome/?p=ui_security_indicator"); |
397 web_contents()->OpenURL(content::OpenURLParams( | 402 web_contents()->OpenURL(content::OpenURLParams( |
398 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), | 403 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), |
399 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 404 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
400 false /* is_renderer_initiated */)); | 405 false /* is_renderer_initiated */)); |
401 } | 406 } |
402 | 407 |
403 } // namespace autofill | 408 } // namespace autofill |
OLD | NEW |