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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 CreateCardUnmaskPromptView(&unmask_controller_, web_contents()), | 167 CreateCardUnmaskPromptView(&unmask_controller_, web_contents()), |
168 card, delegate); | 168 card, delegate); |
169 } | 169 } |
170 | 170 |
171 void ChromeAutofillClient::OnUnmaskVerificationResult( | 171 void ChromeAutofillClient::OnUnmaskVerificationResult( |
172 PaymentsRpcResult result) { | 172 PaymentsRpcResult result) { |
173 unmask_controller_.OnVerificationResult(result); | 173 unmask_controller_.OnVerificationResult(result); |
174 } | 174 } |
175 | 175 |
176 void ChromeAutofillClient::ConfirmSaveCreditCardLocally( | 176 void ChromeAutofillClient::ConfirmSaveCreditCardLocally( |
177 const base::Closure& callback) { | 177 const base::Closure& callback, |
| 178 const CreditCard& card) { |
178 #if !defined(OS_ANDROID) | 179 #if !defined(OS_ANDROID) |
179 if (IsSaveCardBubbleEnabled()) { | 180 if (IsSaveCardBubbleEnabled()) { |
180 // Do lazy initialization of SaveCardBubbleControllerImpl. | 181 // Do lazy initialization of SaveCardBubbleControllerImpl. |
181 autofill::SaveCardBubbleControllerImpl::CreateForWebContents( | 182 autofill::SaveCardBubbleControllerImpl::CreateForWebContents( |
182 web_contents()); | 183 web_contents()); |
183 autofill::SaveCardBubbleControllerImpl* controller = | 184 autofill::SaveCardBubbleControllerImpl* controller = |
184 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 185 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
185 controller->ShowBubbleForLocalSave(callback); | 186 controller->ShowBubbleForLocalSave(callback); |
186 return; | 187 return; |
187 } | 188 } |
188 #endif | 189 #endif |
189 AutofillCCInfoBarDelegate::CreateForLocalSave( | 190 AutofillCCInfoBarDelegate::CreateForLocalSave( |
190 InfoBarService::FromWebContents(web_contents()), callback); | 191 InfoBarService::FromWebContents(web_contents()), callback, card); |
191 } | 192 } |
192 | 193 |
193 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( | 194 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( |
194 const base::Closure& callback, | 195 const base::Closure& callback, |
| 196 const CreditCard& card, |
195 scoped_ptr<base::DictionaryValue> legal_message) { | 197 scoped_ptr<base::DictionaryValue> legal_message) { |
196 // TODO(jdonnelly): Implement save card prompt for OS_IOS. | 198 // TODO(jdonnelly): Implement save card prompt for OS_IOS. |
197 #if defined(OS_ANDROID) | 199 #if defined(OS_ANDROID) |
198 AutofillCCInfoBarDelegate::CreateForUpload( | 200 AutofillCCInfoBarDelegate::CreateForUpload( |
199 InfoBarService::FromWebContents(web_contents()), callback); | 201 InfoBarService::FromWebContents(web_contents()), callback, card, |
| 202 std::move(legal_message)); |
200 #else | 203 #else |
201 // Do lazy initialization of SaveCardBubbleControllerImpl. | 204 // Do lazy initialization of SaveCardBubbleControllerImpl. |
202 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); | 205 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
203 autofill::SaveCardBubbleControllerImpl* controller = | 206 autofill::SaveCardBubbleControllerImpl* controller = |
204 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 207 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
205 controller->ShowBubbleForUpload(callback, std::move(legal_message)); | 208 controller->ShowBubbleForUpload(callback, std::move(legal_message)); |
206 #endif | 209 #endif |
207 } | 210 } |
208 | 211 |
209 void ChromeAutofillClient::LoadRiskData( | 212 void ChromeAutofillClient::LoadRiskData( |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 362 |
360 ssl_status = navigation_entry->GetSSL(); | 363 ssl_status = navigation_entry->GetSSL(); |
361 // Note: If changing the implementation below, also change | 364 // Note: If changing the implementation below, also change |
362 // AwAutofillClient::IsContextSecure. See crbug.com/505388 | 365 // AwAutofillClient::IsContextSecure. See crbug.com/505388 |
363 return ssl_status.security_style == | 366 return ssl_status.security_style == |
364 content::SECURITY_STYLE_AUTHENTICATED && | 367 content::SECURITY_STYLE_AUTHENTICATED && |
365 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT; | 368 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT; |
366 } | 369 } |
367 | 370 |
368 } // namespace autofill | 371 } // namespace autofill |
OLD | NEW |