Chromium Code Reviews| 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() { |