| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 rappor::RapporServiceImpl* ChromeAutofillClient::GetRapporServiceImpl() { | 147 rappor::RapporServiceImpl* ChromeAutofillClient::GetRapporServiceImpl() { |
| 148 return g_browser_process->rappor_service(); | 148 return g_browser_process->rappor_service(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 ukm::UkmService* ChromeAutofillClient::GetUkmService() { | 151 ukm::UkmService* ChromeAutofillClient::GetUkmService() { |
| 152 return g_browser_process->ukm_service(); | 152 return g_browser_process->ukm_service(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 SaveCardBubbleController* ChromeAutofillClient::GetSaveCardBubbleController() { |
| 156 return SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 157 } |
| 158 |
| 155 void ChromeAutofillClient::ShowAutofillSettings() { | 159 void ChromeAutofillClient::ShowAutofillSettings() { |
| 156 #if defined(OS_ANDROID) | 160 #if defined(OS_ANDROID) |
| 157 chrome::android::PreferencesLauncher::ShowAutofillSettings(); | 161 chrome::android::PreferencesLauncher::ShowAutofillSettings(); |
| 158 #else | 162 #else |
| 159 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 163 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 160 if (browser) | 164 if (browser) |
| 161 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); | 165 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); |
| 162 #endif // #if defined(OS_ANDROID) | 166 #endif // #if defined(OS_ANDROID) |
| 163 } | 167 } |
| 164 | 168 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 191 web_contents()); | 195 web_contents()); |
| 192 autofill::SaveCardBubbleControllerImpl* controller = | 196 autofill::SaveCardBubbleControllerImpl* controller = |
| 193 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 197 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 194 controller->ShowBubbleForLocalSave(card, callback); | 198 controller->ShowBubbleForLocalSave(card, callback); |
| 195 #endif | 199 #endif |
| 196 } | 200 } |
| 197 | 201 |
| 198 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( | 202 void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( |
| 199 const CreditCard& card, | 203 const CreditCard& card, |
| 200 std::unique_ptr<base::DictionaryValue> legal_message, | 204 std::unique_ptr<base::DictionaryValue> legal_message, |
| 205 bool upload_cvc_should_be_requested, |
| 201 const base::Closure& callback) { | 206 const base::Closure& callback) { |
| 202 #if defined(OS_ANDROID) | 207 #if defined(OS_ANDROID) |
| 203 InfoBarService::FromWebContents(web_contents()) | 208 InfoBarService::FromWebContents(web_contents()) |
| 204 ->AddInfoBar(CreateSaveCardInfoBarMobile( | 209 ->AddInfoBar(CreateSaveCardInfoBarMobile( |
| 205 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( | 210 base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( |
| 206 true, card, std::move(legal_message), callback))); | 211 true, card, std::move(legal_message), callback))); |
| 207 #else | 212 #else |
| 208 // Do lazy initialization of SaveCardBubbleControllerImpl. | 213 // Do lazy initialization of SaveCardBubbleControllerImpl. |
| 209 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); | 214 autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); |
| 210 autofill::SaveCardBubbleControllerImpl* controller = | 215 autofill::SaveCardBubbleControllerImpl* controller = |
| 211 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); | 216 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); |
| 212 controller->ShowBubbleForUpload(card, std::move(legal_message), callback); | 217 controller->ShowBubbleForUpload(card, std::move(legal_message), |
| 218 upload_cvc_should_be_requested, callback); |
| 213 #endif | 219 #endif |
| 214 } | 220 } |
| 215 | 221 |
| 216 void ChromeAutofillClient::ConfirmCreditCardFillAssist( | 222 void ChromeAutofillClient::ConfirmCreditCardFillAssist( |
| 217 const CreditCard& card, | 223 const CreditCard& card, |
| 218 const base::Closure& callback) { | 224 const base::Closure& callback) { |
| 219 #if defined(OS_ANDROID) | 225 #if defined(OS_ANDROID) |
| 220 auto infobar_delegate = | 226 auto infobar_delegate = |
| 221 base::MakeUnique<AutofillCreditCardFillingInfoBarDelegateMobile>( | 227 base::MakeUnique<AutofillCreditCardFillingInfoBarDelegateMobile>( |
| 222 card, callback); | 228 card, callback); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // directly. | 395 // directly. |
| 390 const GURL kSecurityIndicatorHelpCenterUrl( | 396 const GURL kSecurityIndicatorHelpCenterUrl( |
| 391 "https://support.google.com/chrome/?p=ui_security_indicator"); | 397 "https://support.google.com/chrome/?p=ui_security_indicator"); |
| 392 web_contents()->OpenURL(content::OpenURLParams( | 398 web_contents()->OpenURL(content::OpenURLParams( |
| 393 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), | 399 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), |
| 394 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 400 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 395 false /* is_renderer_initiated */)); | 401 false /* is_renderer_initiated */)); |
| 396 } | 402 } |
| 397 | 403 |
| 398 } // namespace autofill | 404 } // namespace autofill |
| OLD | NEW |