Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 710453002: [Autofill] Componentize AutofillCCInfoBarDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed breakages on Android port. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h"
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" 9 #include "chrome/browser/autofill/personal_data_manager_factory.h"
11 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 11 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
13 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" 13 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
15 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" 14 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
16 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" 15 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h"
17 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" 16 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h"
18 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
20 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/browser/ui/chrome_pages.h" 20 #include "chrome/browser/ui/chrome_pages.h"
22 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 21 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
23 #include "chrome/browser/webdata/web_data_service_factory.h" 22 #include "chrome/browser/webdata/web_data_service_factory.h"
24 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
25 #include "components/autofill/content/browser/content_autofill_driver.h" 24 #include "components/autofill/content/browser/content_autofill_driver.h"
26 #include "components/autofill/content/common/autofill_messages.h" 25 #include "components/autofill/content/common/autofill_messages.h"
26 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
27 #include "components/autofill/core/common/autofill_pref_names.h" 27 #include "components/autofill/core/common/autofill_pref_names.h"
28 #include "components/password_manager/content/browser/content_password_manager_d river.h" 28 #include "components/password_manager/content/browser/content_password_manager_d river.h"
29 #include "content/public/browser/render_frame_host.h" 29 #include "content/public/browser/render_frame_host.h"
30 #include "ui/gfx/geometry/rect.h" 30 #include "ui/gfx/geometry/rect.h"
31 31
32 #if defined(OS_ANDROID) 32 #if defined(OS_ANDROID)
33 #include "chrome/browser/android/chromium_application.h" 33 #include "chrome/browser/android/chromium_application.h"
34 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" 34 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h"
35 #else 35 #else
36 #include "components/ui/zoom/zoom_controller.h" 36 #include "components/ui/zoom/zoom_controller.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 base::WeakPtr<CardUnmaskDelegate> delegate) { 114 base::WeakPtr<CardUnmaskDelegate> delegate) {
115 unmask_controller_.ShowPrompt(card, delegate); 115 unmask_controller_.ShowPrompt(card, delegate);
116 } 116 }
117 117
118 void ChromeAutofillClient::OnUnmaskVerificationResult(bool success) { 118 void ChromeAutofillClient::OnUnmaskVerificationResult(bool success) {
119 unmask_controller_.OnVerificationResult(success); 119 unmask_controller_.OnVerificationResult(success);
120 } 120 }
121 121
122 void ChromeAutofillClient::ConfirmSaveCreditCard( 122 void ChromeAutofillClient::ConfirmSaveCreditCard(
123 const base::Closure& save_card_callback) { 123 const base::Closure& save_card_callback) {
124 InfoBarService* infobar_service = 124 AutofillCCInfoBarDelegate::Create(
125 InfoBarService::FromWebContents(web_contents()); 125 InfoBarService::FromWebContents(web_contents()), this,
126 AutofillCCInfoBarDelegate::Create(infobar_service, save_card_callback); 126 save_card_callback);
127 } 127 }
128 128
129 bool ChromeAutofillClient::HasCreditCardScanFeature() { 129 bool ChromeAutofillClient::HasCreditCardScanFeature() {
130 return CreditCardScannerController::HasCreditCardScanFeature(); 130 return CreditCardScannerController::HasCreditCardScanFeature();
131 } 131 }
132 132
133 void ChromeAutofillClient::ScanCreditCard( 133 void ChromeAutofillClient::ScanCreditCard(
134 const CreditCardScanCallback& callback) { 134 const CreditCardScanCallback& callback) {
135 CreditCardScannerController::ScanCreditCard(web_contents(), callback); 135 CreditCardScannerController::ScanCreditCard(web_contents(), callback);
136 } 136 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, 245 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value,
246 profile_full_name); 246 profile_full_name);
247 #endif // defined(OS_ANDROID) 247 #endif // defined(OS_ANDROID)
248 } 248 }
249 249
250 void ChromeAutofillClient::OnFirstUserGestureObserved() { 250 void ChromeAutofillClient::OnFirstUserGestureObserved() {
251 web_contents()->SendToAllFrames( 251 web_contents()->SendToAllFrames(
252 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); 252 new AutofillMsg_FirstUserGestureObservedInTab(routing_id()));
253 } 253 }
254 254
255 void ChromeAutofillClient::LinkClicked(const GURL& url,
256 WindowOpenDisposition disposition) {
257 web_contents()->OpenURL(content::OpenURLParams(
258 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false));
259 }
260
255 } // namespace autofill 261 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698