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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/autofill/autofill_client_ios.mm
diff --git a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
index 427c05435696d45cdc7c9f886c3ea705b9e84b16..15cd25e29a5c51be9937b6b4beb29fe4c2849041 100644
--- a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
@@ -27,16 +27,22 @@
#include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h"
#include "ios/chrome/browser/web_data_service_factory.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+#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.
+#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.
+#include "ios/web/public/ssl_status.h"
+#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.
namespace autofill {
AutofillClientIOS::AutofillClientIOS(
ios::ChromeBrowserState* browser_state,
+ web::WebState* web_state,
infobars::InfoBarManager* infobar_manager,
id<AutofillClientIOSBridge> bridge,
password_manager::PasswordGenerationManager* password_generation_manager,
std::unique_ptr<IdentityProvider> identity_provider)
: browser_state_(browser_state),
+ web_state_(web_state),
infobar_manager_(infobar_manager),
bridge_(bridge),
password_generation_manager_(password_generation_manager),
@@ -179,10 +185,16 @@ scoped_refptr<AutofillWebDataService> AutofillClientIOS::GetDatabase() {
browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
}
-bool AutofillClientIOS::IsContextSecure(const GURL& form_origin) {
- // TODO (sigbjorn): Return if the context is secure, not just
- // the form_origin. See crbug.com/505388.
- return form_origin.SchemeIsCryptographic();
+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.
+ web::NavigationManager* manager = web_state_->GetNavigationManager();
+ 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.
+ if (!navItem)
+ return false;
+
+ const web::SSLStatus& ssl = navItem->GetSSL();
+ return navItem->GetURL().SchemeIsCryptographic() && ssl.certificate &&
+ (!net::IsCertStatusError(ssl.cert_status) ||
+ 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
}
void AutofillClientIOS::OnFirstUserGestureObserved() {
« 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