| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "chrome/browser/android/chrome_application.h" | 55 #include "chrome/browser/android/chrome_application.h" |
| 56 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" | 56 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" |
| 57 #else | 57 #else |
| 58 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 58 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 59 #include "components/zoom/zoom_controller.h" | 59 #include "components/zoom/zoom_controller.h" |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 #if defined(OS_ANDROID) | 62 #if defined(OS_ANDROID) |
| 63 #include "base/android/context_utils.h" | 63 #include "base/android/context_utils.h" |
| 64 #include "chrome/browser/android/signin/signin_promo_util_android.h" | 64 #include "chrome/browser/android/signin/signin_promo_util_android.h" |
| 65 #include "components/autofill/core/browser/autofill_assist_infobar_delegate_mobi
le.h" |
| 66 #include "components/autofill/core/browser/autofill_assist_infobar_mobile.h" |
| 65 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" | 67 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" |
| 66 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" | 68 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" |
| 67 #include "components/infobars/core/infobar.h" | 69 #include "components/infobars/core/infobar.h" |
| 68 #include "content/public/browser/android/content_view_core.h" | 70 #include "content/public/browser/android/content_view_core.h" |
| 69 #endif | 71 #endif |
| 70 | 72 |
| 71 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); | 73 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); |
| 72 | 74 |
| 73 namespace autofill { | 75 namespace autofill { |
| 74 | 76 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 true, card, std::move(legal_message), callback)))); | 206 true, card, std::move(legal_message), callback)))); |
| 205 #else | 207 #else |
| 206 // Do lazy initialization of SaveCardBubbleControllerImpl. | 208 // Do lazy initialization of SaveCardBubbleControllerImpl. |
| 207 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); | 209 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
| 208 autofill::SaveCardBubbleControllerImpl* controller = | 210 autofill::SaveCardBubbleControllerImpl* controller = |
| 209 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 211 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 210 controller->ShowBubbleForUpload(card, std::move(legal_message), callback); | 212 controller->ShowBubbleForUpload(card, std::move(legal_message), callback); |
| 211 #endif | 213 #endif |
| 212 } | 214 } |
| 213 | 215 |
| 216 void ChromeAutofillClient::ConfirmCreditCardFillAssist( |
| 217 const CreditCard& card, |
| 218 const base::Closure& callback) { |
| 219 #if defined(OS_ANDROID) |
| 220 InfoBarService::FromWebContents(web_contents()) |
| 221 ->AddInfoBar(CreateAssistInfoBar(base::WrapUnique( |
| 222 new AutofillAssistInfoBarDelegateMobile(card, callback)))); |
| 223 #endif |
| 224 } |
| 225 |
| 214 void ChromeAutofillClient::LoadRiskData( | 226 void ChromeAutofillClient::LoadRiskData( |
| 215 const base::Callback<void(const std::string&)>& callback) { | 227 const base::Callback<void(const std::string&)>& callback) { |
| 216 ::autofill::LoadRiskData(0, web_contents(), callback); | 228 ::autofill::LoadRiskData(0, web_contents(), callback); |
| 217 } | 229 } |
| 218 | 230 |
| 219 bool ChromeAutofillClient::HasCreditCardScanFeature() { | 231 bool ChromeAutofillClient::HasCreditCardScanFeature() { |
| 220 return CreditCardScannerController::HasCreditCardScanFeature(); | 232 return CreditCardScannerController::HasCreditCardScanFeature(); |
| 221 } | 233 } |
| 222 | 234 |
| 223 void ChromeAutofillClient::ScanCreditCard( | 235 void ChromeAutofillClient::ScanCreditCard( |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 chrome::FindBrowserWithWebContents(web_contents()) | 376 chrome::FindBrowserWithWebContents(web_contents()) |
| 365 ->window() | 377 ->window() |
| 366 ->ShowAvatarBubbleFromAvatarButton( | 378 ->ShowAvatarBubbleFromAvatarButton( |
| 367 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 379 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
| 368 signin::ManageAccountsParams(), | 380 signin::ManageAccountsParams(), |
| 369 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 381 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
| 370 #endif | 382 #endif |
| 371 } | 383 } |
| 372 | 384 |
| 373 } // namespace autofill | 385 } // namespace autofill |
| OLD | NEW |