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

Side by Side Diff: ios/chrome/browser/ui/autofill/autofill_client_ios.mm

Issue 2672623005: Record Autofill form events specially for nonsecure pages (Closed)
Patch Set: fix autofillassistant call site Created 3 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "ios/chrome/browser/ui/autofill/autofill_client_ios.h" 5 #import "ios/chrome/browser/ui/autofill/autofill_client_ios.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_ delegate_mobile.h" 11 #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_ delegate_mobile.h"
12 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m obile.h" 12 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m obile.h"
13 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" 13 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h"
14 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" 14 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h"
15 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 15 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
16 #include "components/autofill/core/common/autofill_pref_names.h" 16 #include "components/autofill/core/common/autofill_pref_names.h"
17 #include "components/infobars/core/infobar.h" 17 #include "components/infobars/core/infobar.h"
18 #include "components/infobars/core/infobar_manager.h" 18 #include "components/infobars/core/infobar_manager.h"
19 #include "components/keyed_service/core/service_access_type.h" 19 #include "components/keyed_service/core/service_access_type.h"
20 #include "components/password_manager/core/browser/password_generation_manager.h " 20 #include "components/password_manager/core/browser/password_generation_manager.h "
21 #include "components/prefs/pref_service.h" 21 #include "components/prefs/pref_service.h"
22 #include "google_apis/gaia/identity_provider.h" 22 #include "google_apis/gaia/identity_provider.h"
23 #include "ios/chrome/browser/application_context.h" 23 #include "ios/chrome/browser/application_context.h"
24 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" 24 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
25 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 25 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
26 #include "ios/chrome/browser/infobars/infobar_utils.h" 26 #include "ios/chrome/browser/infobars/infobar_utils.h"
27 #include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h" 27 #include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h"
28 #include "ios/chrome/browser/web_data_service_factory.h" 28 #include "ios/chrome/browser/web_data_service_factory.h"
29 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 29 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
30 #include "ios/web/public/navigation_item.h"
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 s/include/import https://google.github.io/stylegu
estark 2017/02/07 22:40:34 Done.
31 #include "ios/web/public/navigation_manager.h"
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 ditto
estark 2017/02/07 22:40:33 Done.
32 #include "ios/web/public/ssl_status.h"
33 #include "ios/web/public/web_state/web_state.h"
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 ditto
estark 2017/02/07 22:40:34 Done.
30 34
31 namespace autofill { 35 namespace autofill {
32 36
33 AutofillClientIOS::AutofillClientIOS( 37 AutofillClientIOS::AutofillClientIOS(
34 ios::ChromeBrowserState* browser_state, 38 ios::ChromeBrowserState* browser_state,
39 web::WebState* web_state,
35 infobars::InfoBarManager* infobar_manager, 40 infobars::InfoBarManager* infobar_manager,
36 id<AutofillClientIOSBridge> bridge, 41 id<AutofillClientIOSBridge> bridge,
37 password_manager::PasswordGenerationManager* password_generation_manager, 42 password_manager::PasswordGenerationManager* password_generation_manager,
38 std::unique_ptr<IdentityProvider> identity_provider) 43 std::unique_ptr<IdentityProvider> identity_provider)
39 : browser_state_(browser_state), 44 : browser_state_(browser_state),
45 web_state_(web_state),
40 infobar_manager_(infobar_manager), 46 infobar_manager_(infobar_manager),
41 bridge_(bridge), 47 bridge_(bridge),
42 password_generation_manager_(password_generation_manager), 48 password_generation_manager_(password_generation_manager),
43 identity_provider_(std::move(identity_provider)), 49 identity_provider_(std::move(identity_provider)),
44 unmask_controller_(browser_state->GetPrefs(), 50 unmask_controller_(browser_state->GetPrefs(),
45 browser_state->IsOffTheRecord()) {} 51 browser_state->IsOffTheRecord()) {}
46 52
47 AutofillClientIOS::~AutofillClientIOS() { 53 AutofillClientIOS::~AutofillClientIOS() {
48 HideAutofillPopup(); 54 HideAutofillPopup();
49 } 55 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 void AutofillClientIOS::DidFillOrPreviewField( 178 void AutofillClientIOS::DidFillOrPreviewField(
173 const base::string16& autofilled_value, 179 const base::string16& autofilled_value,
174 const base::string16& profile_full_name) { 180 const base::string16& profile_full_name) {
175 } 181 }
176 182
177 scoped_refptr<AutofillWebDataService> AutofillClientIOS::GetDatabase() { 183 scoped_refptr<AutofillWebDataService> AutofillClientIOS::GetDatabase() {
178 return ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState( 184 return ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState(
179 browser_state_, ServiceAccessType::EXPLICIT_ACCESS); 185 browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
180 } 186 }
181 187
182 bool AutofillClientIOS::IsContextSecure(const GURL& form_origin) { 188 bool AutofillClientIOS::IsContextSecure() {
Justin Donnelly 2017/02/07 17:42:45 Can you add a comment to this function explaining
estark 2017/02/07 22:40:34 Done.
183 // TODO (sigbjorn): Return if the context is secure, not just 189 web::NavigationManager* manager = web_state_->GetNavigationManager();
184 // the form_origin. See crbug.com/505388. 190 web::NavigationItem* navItem = manager->GetVisibleItem();
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 s/navItem/nav_item
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 Do you want to use LastCommittedItem instead? La
estark 2017/02/07 22:40:33 Done.
estark 2017/02/07 22:40:33 Done.
185 return form_origin.SchemeIsCryptographic(); 191 if (!navItem)
192 return false;
193
194 const web::SSLStatus& ssl = navItem->GetSSL();
195 return navItem->GetURL().SchemeIsCryptographic() && ssl.certificate &&
196 (!net::IsCertStatusError(ssl.cert_status) ||
197 net::IsCertStatusMinorError(ssl.cert_status));
Eugene But (OOO till 7-30) 2017/02/07 18:47:08 Do you want to check for |SECURITY_STYLE_AUTHENTIC
estark 2017/02/07 22:40:34 |security_style| doesn't exist in //content anymor
186 } 198 }
187 199
188 void AutofillClientIOS::OnFirstUserGestureObserved() { 200 void AutofillClientIOS::OnFirstUserGestureObserved() {
189 // TODO(gcasto): [Merge 306796] http://crbug.com/439425 Verify if this method 201 // TODO(gcasto): [Merge 306796] http://crbug.com/439425 Verify if this method
190 // needs a real implementation or not. 202 // needs a real implementation or not.
191 NOTIMPLEMENTED(); 203 NOTIMPLEMENTED();
192 } 204 }
193 205
194 bool AutofillClientIOS::ShouldShowSigninPromo() { 206 bool AutofillClientIOS::ShouldShowSigninPromo() {
195 return false; 207 return false;
196 } 208 }
197 209
198 void AutofillClientIOS::StartSigninFlow() { 210 void AutofillClientIOS::StartSigninFlow() {
199 NOTIMPLEMENTED(); 211 NOTIMPLEMENTED();
200 } 212 }
201 213
202 void AutofillClientIOS::ShowHttpNotSecureExplanation() { 214 void AutofillClientIOS::ShowHttpNotSecureExplanation() {
203 NOTIMPLEMENTED(); 215 NOTIMPLEMENTED();
204 } 216 }
205 217
206 } // namespace autofill 218 } // namespace autofill
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/autofill/autofill_client_ios.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698