| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 11 #include "chrome/browser/autofill/risk_util.h" | 11 #include "chrome/browser/autofill/risk_util.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
| 14 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 14 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 17 #include "chrome/browser/signin/signin_manager_factory.h" | 17 #include "chrome/browser/signin/signin_manager_factory.h" |
| 18 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
| 19 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 19 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 20 #include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h" | 20 #include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h" |
| 21 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" | 21 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" |
| 22 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" |
| 22 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_finder.h" | 24 #include "chrome/browser/ui/browser_finder.h" |
| 24 #include "chrome/browser/ui/browser_window.h" | 25 #include "chrome/browser/ui/browser_window.h" |
| 25 #include "chrome/browser/ui/chrome_pages.h" | 26 #include "chrome/browser/ui/chrome_pages.h" |
| 26 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 27 #include "chrome/browser/web_data_service_factory.h" | 28 #include "chrome/browser/web_data_service_factory.h" |
| 28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 29 #include "components/autofill/content/browser/content_autofill_driver.h" | 30 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 30 #include "components/autofill/content/common/autofill_messages.h" | 31 #include "components/autofill/content/common/autofill_messages.h" |
| 31 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h" | 32 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 CreateCardUnmaskPromptView(&unmask_controller_, web_contents()), | 147 CreateCardUnmaskPromptView(&unmask_controller_, web_contents()), |
| 147 card, delegate); | 148 card, delegate); |
| 148 } | 149 } |
| 149 | 150 |
| 150 void ChromeAutofillClient::OnUnmaskVerificationResult(GetRealPanResult result) { | 151 void ChromeAutofillClient::OnUnmaskVerificationResult(GetRealPanResult result) { |
| 151 unmask_controller_.OnVerificationResult(result); | 152 unmask_controller_.OnVerificationResult(result); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void ChromeAutofillClient::ConfirmSaveCreditCard( | 155 void ChromeAutofillClient::ConfirmSaveCreditCard( |
| 155 const base::Closure& save_card_callback) { | 156 const base::Closure& save_card_callback) { |
| 157 // TODO(bondd): Implement save card bubble for OS_MACOSX. |
| 158 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
| 159 // Do lazy initialization of SaveCardBubbleControllerImpl. |
| 160 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
| 161 autofill::SaveCardBubbleControllerImpl* controller = |
| 162 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 163 controller->SetCallback(save_card_callback); |
| 164 controller->ShowBubble(); |
| 165 #else |
| 156 AutofillCCInfoBarDelegate::Create( | 166 AutofillCCInfoBarDelegate::Create( |
| 157 InfoBarService::FromWebContents(web_contents()), this, | 167 InfoBarService::FromWebContents(web_contents()), this, |
| 158 save_card_callback); | 168 save_card_callback); |
| 169 #endif |
| 159 } | 170 } |
| 160 | 171 |
| 161 bool ChromeAutofillClient::HasCreditCardScanFeature() { | 172 bool ChromeAutofillClient::HasCreditCardScanFeature() { |
| 162 return CreditCardScannerController::HasCreditCardScanFeature(); | 173 return CreditCardScannerController::HasCreditCardScanFeature(); |
| 163 } | 174 } |
| 164 | 175 |
| 165 void ChromeAutofillClient::ScanCreditCard( | 176 void ChromeAutofillClient::ScanCreditCard( |
| 166 const CreditCardScanCallback& callback) { | 177 const CreditCardScanCallback& callback) { |
| 167 CreditCardScannerController::ScanCreditCard(web_contents(), callback); | 178 CreditCardScannerController::ScanCreditCard(web_contents(), callback); |
| 168 } | 179 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 316 |
| 306 ssl_status = navigation_entry->GetSSL(); | 317 ssl_status = navigation_entry->GetSSL(); |
| 307 // Note: If changing the implementation below, also change | 318 // Note: If changing the implementation below, also change |
| 308 // AwAutofillClient::IsContextSecure. See crbug.com/505388 | 319 // AwAutofillClient::IsContextSecure. See crbug.com/505388 |
| 309 return ssl_status.security_style == | 320 return ssl_status.security_style == |
| 310 content::SECURITY_STYLE_AUTHENTICATED && | 321 content::SECURITY_STYLE_AUTHENTICATED && |
| 311 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT; | 322 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT; |
| 312 } | 323 } |
| 313 | 324 |
| 314 } // namespace autofill | 325 } // namespace autofill |
| OLD | NEW |