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

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: Modified AutofillCCInfoBarDelegate unit-tests. Created 6 years, 1 month 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
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/browser.h" 15 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_finder.h" 16 #include "chrome/browser/ui/browser_finder.h"
18 #include "chrome/browser/ui/browser_window.h" 17 #include "chrome/browser/ui/browser_window.h"
19 #include "chrome/browser/ui/chrome_pages.h" 18 #include "chrome/browser/ui/chrome_pages.h"
20 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 19 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
21 #include "chrome/browser/webdata/web_data_service_factory.h" 20 #include "chrome/browser/webdata/web_data_service_factory.h"
22 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
22 #include "components/autofill/content/browser/autofill_cc_infobar_delegate.h"
23 #include "components/autofill/content/browser/content_autofill_driver.h" 23 #include "components/autofill/content/browser/content_autofill_driver.h"
24 #include "components/autofill/content/common/autofill_messages.h" 24 #include "components/autofill/content/common/autofill_messages.h"
25 #include "components/autofill/core/common/autofill_pref_names.h" 25 #include "components/autofill/core/common/autofill_pref_names.h"
26 #include "content/public/browser/render_view_host.h" 26 #include "content/public/browser/render_view_host.h"
27 #include "ui/gfx/rect.h" 27 #include "ui/gfx/rect.h"
28 28
29 #if defined(OS_ANDROID) 29 #if defined(OS_ANDROID)
30 #include "chrome/browser/android/chromium_application.h" 30 #include "chrome/browser/android/chromium_application.h"
31 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" 31 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h"
32 #else 32 #else
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (browser) 102 if (browser)
103 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); 103 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage);
104 #endif // #if defined(OS_ANDROID) 104 #endif // #if defined(OS_ANDROID)
105 } 105 }
106 106
107 void ChromeAutofillClient::ConfirmSaveCreditCard( 107 void ChromeAutofillClient::ConfirmSaveCreditCard(
108 const AutofillMetrics& metric_logger, 108 const AutofillMetrics& metric_logger,
109 const base::Closure& save_card_callback) { 109 const base::Closure& save_card_callback) {
110 InfoBarService* infobar_service = 110 InfoBarService* infobar_service =
111 InfoBarService::FromWebContents(web_contents_); 111 InfoBarService::FromWebContents(web_contents_);
112 AutofillCCInfoBarDelegate::Create( 112 AutofillCCInfoBarDelegate::Create(web_contents_, infobar_service,
113 infobar_service, &metric_logger, save_card_callback); 113 &metric_logger, save_card_callback);
114 } 114 }
115 115
116 void ChromeAutofillClient::ShowRequestAutocompleteDialog( 116 void ChromeAutofillClient::ShowRequestAutocompleteDialog(
117 const FormData& form, 117 const FormData& form,
118 const GURL& source_url, 118 const GURL& source_url,
119 const ResultCallback& callback) { 119 const ResultCallback& callback) {
120 HideRequestAutocompleteDialog(); 120 HideRequestAutocompleteDialog();
121 121
122 dialog_controller_ = AutofillDialogController::Create( 122 dialog_controller_ = AutofillDialogController::Create(
123 web_contents_, form, source_url, callback); 123 web_contents_, form, source_url, callback);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void ChromeAutofillClient::DidFillOrPreviewField( 206 void ChromeAutofillClient::DidFillOrPreviewField(
207 const base::string16& autofilled_value, 207 const base::string16& autofilled_value,
208 const base::string16& profile_full_name) { 208 const base::string16& profile_full_name) {
209 #if defined(OS_ANDROID) 209 #if defined(OS_ANDROID)
210 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, 210 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value,
211 profile_full_name); 211 profile_full_name);
212 #endif // defined(OS_ANDROID) 212 #endif // defined(OS_ANDROID)
213 } 213 }
214 214
215 } // namespace autofill 215 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698