| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 PaymentsRpcResult result) { | 176 PaymentsRpcResult result) { |
| 177 unmask_controller_.OnVerificationResult(result); | 177 unmask_controller_.OnVerificationResult(result); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void ChromeAutofillClient::ConfirmSaveCreditCardLocally( | 180 void ChromeAutofillClient::ConfirmSaveCreditCardLocally( |
| 181 const CreditCard& card, | 181 const CreditCard& card, |
| 182 const base::Closure& callback) { | 182 const base::Closure& callback) { |
| 183 #if defined(OS_ANDROID) | 183 #if defined(OS_ANDROID) |
| 184 InfoBarService::FromWebContents(web_contents()) | 184 InfoBarService::FromWebContents(web_contents()) |
| 185 ->AddInfoBar(CreateSaveCardInfoBarMobile( | 185 ->AddInfoBar(CreateSaveCardInfoBarMobile( |
| 186 base::WrapUnique(new AutofillSaveCardInfoBarDelegateMobile( | 186 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( |
| 187 false, card, std::unique_ptr<base::DictionaryValue>(nullptr), | 187 false, card, std::unique_ptr<base::DictionaryValue>(nullptr), |
| 188 callback)))); | 188 callback))); |
| 189 #else | 189 #else |
| 190 // Do lazy initialization of SaveCardBubbleControllerImpl. | 190 // Do lazy initialization of SaveCardBubbleControllerImpl. |
| 191 autofill::SaveCardBubbleControllerImpl::CreateForWebContents( | 191 autofill::SaveCardBubbleControllerImpl::CreateForWebContents( |
| 192 web_contents()); | 192 web_contents()); |
| 193 autofill::SaveCardBubbleControllerImpl* controller = | 193 autofill::SaveCardBubbleControllerImpl* controller = |
| 194 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 194 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 195 controller->ShowBubbleForLocalSave(card, callback); | 195 controller->ShowBubbleForLocalSave(card, callback); |
| 196 #endif | 196 #endif |
| 197 } | 197 } |
| 198 | 198 |
| 199 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( | 199 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( |
| 200 const CreditCard& card, | 200 const CreditCard& card, |
| 201 std::unique_ptr<base::DictionaryValue> legal_message, | 201 std::unique_ptr<base::DictionaryValue> legal_message, |
| 202 const base::Closure& callback) { | 202 const base::Closure& callback) { |
| 203 #if defined(OS_ANDROID) | 203 #if defined(OS_ANDROID) |
| 204 InfoBarService::FromWebContents(web_contents()) | 204 InfoBarService::FromWebContents(web_contents()) |
| 205 ->AddInfoBar(CreateSaveCardInfoBarMobile( | 205 ->AddInfoBar(CreateSaveCardInfoBarMobile( |
| 206 base::WrapUnique(new AutofillSaveCardInfoBarDelegateMobile( | 206 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( |
| 207 true, card, std::move(legal_message), callback)))); | 207 true, card, std::move(legal_message), callback))); |
| 208 #else | 208 #else |
| 209 // Do lazy initialization of SaveCardBubbleControllerImpl. | 209 // Do lazy initialization of SaveCardBubbleControllerImpl. |
| 210 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); | 210 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
| 211 autofill::SaveCardBubbleControllerImpl* controller = | 211 autofill::SaveCardBubbleControllerImpl* controller = |
| 212 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 212 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 213 controller->ShowBubbleForUpload(card, std::move(legal_message), callback); | 213 controller->ShowBubbleForUpload(card, std::move(legal_message), callback); |
| 214 #endif | 214 #endif |
| 215 } | 215 } |
| 216 | 216 |
| 217 void ChromeAutofillClient::ConfirmCreditCardFillAssist( | 217 void ChromeAutofillClient::ConfirmCreditCardFillAssist( |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 chrome::FindBrowserWithWebContents(web_contents()) | 383 chrome::FindBrowserWithWebContents(web_contents()) |
| 384 ->window() | 384 ->window() |
| 385 ->ShowAvatarBubbleFromAvatarButton( | 385 ->ShowAvatarBubbleFromAvatarButton( |
| 386 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 386 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
| 387 signin::ManageAccountsParams(), | 387 signin::ManageAccountsParams(), |
| 388 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 388 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
| 389 #endif | 389 #endif |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace autofill | 392 } // namespace autofill |
| OLD | NEW |