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/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" | 9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/ui/zoom/zoom_controller.h" | 21 #include "chrome/browser/ui/zoom/zoom_controller.h" |
22 #include "chrome/browser/webdata/web_data_service_factory.h" | 22 #include "chrome/browser/webdata/web_data_service_factory.h" |
23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
24 #include "components/autofill/content/browser/content_autofill_driver.h" | 24 #include "components/autofill/content/browser/content_autofill_driver.h" |
25 #include "components/autofill/content/common/autofill_messages.h" | 25 #include "components/autofill/content/common/autofill_messages.h" |
26 #include "components/autofill/core/common/autofill_pref_names.h" | 26 #include "components/autofill/core/common/autofill_pref_names.h" |
27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
29 | 29 |
30 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 31 #include "chrome/browser/android/chromium_application.h" |
31 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" | 32 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" |
32 #endif | 33 #endif |
33 | 34 |
34 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); | 35 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); |
35 | 36 |
36 namespace autofill { | 37 namespace autofill { |
37 | 38 |
38 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) | 39 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) |
39 : content::WebContentsObserver(web_contents), web_contents_(web_contents) { | 40 : content::WebContentsObserver(web_contents), web_contents_(web_contents) { |
40 DCHECK(web_contents); | 41 DCHECK(web_contents); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 profile, Profile::EXPLICIT_ACCESS); | 84 profile, Profile::EXPLICIT_ACCESS); |
84 } | 85 } |
85 | 86 |
86 PrefService* ChromeAutofillClient::GetPrefs() { | 87 PrefService* ChromeAutofillClient::GetPrefs() { |
87 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()) | 88 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()) |
88 ->GetPrefs(); | 89 ->GetPrefs(); |
89 } | 90 } |
90 | 91 |
91 void ChromeAutofillClient::ShowAutofillSettings() { | 92 void ChromeAutofillClient::ShowAutofillSettings() { |
92 #if defined(OS_ANDROID) | 93 #if defined(OS_ANDROID) |
93 NOTIMPLEMENTED(); | 94 chrome::android::ChromiumApplication::ShowAutofillSettings(); |
94 #else | 95 #else |
95 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 96 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
96 if (browser) | 97 if (browser) |
97 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); | 98 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); |
98 #endif // #if defined(OS_ANDROID) | 99 #endif // #if defined(OS_ANDROID) |
99 } | 100 } |
100 | 101 |
101 void ChromeAutofillClient::ConfirmSaveCreditCard( | 102 void ChromeAutofillClient::ConfirmSaveCreditCard( |
102 const AutofillMetrics& metric_logger, | 103 const AutofillMetrics& metric_logger, |
103 const base::Closure& save_card_callback) { | 104 const base::Closure& save_card_callback) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void ChromeAutofillClient::DidFillOrPreviewField( | 201 void ChromeAutofillClient::DidFillOrPreviewField( |
201 const base::string16& autofilled_value, | 202 const base::string16& autofilled_value, |
202 const base::string16& profile_full_name) { | 203 const base::string16& profile_full_name) { |
203 #if defined(OS_ANDROID) | 204 #if defined(OS_ANDROID) |
204 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, | 205 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, |
205 profile_full_name); | 206 profile_full_name); |
206 #endif // defined(OS_ANDROID) | 207 #endif // defined(OS_ANDROID) |
207 } | 208 } |
208 | 209 |
209 } // namespace autofill | 210 } // namespace autofill |
OLD | NEW |