[M47_2526] Chromium upversion to m47_2526 branch
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / browser / password_manager / password_manager.cc
index 63f95ee..482c3f3 100644 (file)
@@ -21,6 +21,7 @@
 #include "components/password_manager/core/browser/password_manager_metrics_util.h"
 #include "components/password_manager/core/common/password_manager_pref_names.h"
 #include "components/pref_registry/pref_registry_syncable.h"
+#include "content/public/common/origin_util.h"
 
 using autofill::PasswordForm;
 using autofill::PasswordFormMap;
@@ -84,7 +85,7 @@ void PasswordManager::SetFormHasGeneratedPassword(const PasswordForm& form) {
   // If there is no corresponding PasswordFormManager, we create one. This is
   // not the common case, and should only happen when there is a bug in our
   // ability to detect forms.
-  bool ssl_valid = (form.origin.SchemeIsSecure() &&
+  bool ssl_valid = (content::IsOriginSecure(form.origin) &&
                     !driver_->DidLastPageLoadEncounterSSLErrors());
   PasswordFormManager* manager = new PasswordFormManager(
       this, client_, driver_, form, ssl_valid);
@@ -177,15 +178,14 @@ void PasswordManager::ProvisionallySavePassword(const PasswordForm& form)
   // Always save generated passwords, as the user expresses explicit intent for
   // Chrome to manage such passwords. For other passwords, respect the
   // autocomplete attribute if autocomplete='off' is not ignored.
-  if (!manager->HasGeneratedPassword() &&
-      !form.password_autocomplete_set) {
+  if (!manager->HasGeneratedPassword()) {
     RecordFailure(AUTOCOMPLETE_OFF, form.origin.host());
     return;
   }
 
   PasswordForm provisionally_saved_form(form);
   provisionally_saved_form.ssl_valid =
-      form.origin.SchemeIsSecure() &&
+      content::IsOriginSecure(form.origin) &&
       !driver_->DidLastPageLoadEncounterSSLErrors();
   provisionally_saved_form.preferred = true;
   PasswordFormManager::OtherPossibleUsernamesAction action =
@@ -242,10 +242,10 @@ void PasswordManager::OnPasswordFormsParsed(
        iter != forms.end(); ++iter) {
     // Don't involve the password manager if this form corresponds to
     // SpdyProxy authentication, as indicated by the realm.
-    if (EndsWith(iter->signon_realm, kSpdyProxyRealm, true))
+    if (base::EndsWith(iter->signon_realm, kSpdyProxyRealm, base::CompareCase::SENSITIVE))
       continue;
 
-    bool ssl_valid = iter->origin.SchemeIsSecure() && !had_ssl_error;
+    bool ssl_valid = content::IsOriginSecure(iter->origin) && !had_ssl_error;
     PasswordFormManager* manager = new PasswordFormManager(
         this, client_, driver_, *iter, ssl_valid);
     pending_login_managers_.push_back(manager);