Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / password_manager / password_store_win.cc
index 1db07ea..ada21dc 100644 (file)
@@ -12,9 +12,9 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/password_manager/password_manager.h"
-#include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/webdata/web_data_service.h"
 #include "components/webdata/encryptor/ie7_password_win.h"
+#include "content/public/browser/browser_thread.h"
 
 using autofill::PasswordForm;
 using content::BrowserThread;
@@ -117,12 +117,15 @@ std::vector<PasswordForm*> PasswordStoreWin::DBHandler::GetIE7Results(
                                        info.encrypted_data,
                                        &credentials)) {
       for (size_t i = 0; i < credentials.size(); ++i) {
-        PasswordForm* autofill = new PasswordForm(form);
+        PasswordForm* autofill = new PasswordForm();
         autofill->username_value = credentials[i].username;
         autofill->password_value = credentials[i].password;
+        autofill->signon_realm = form.signon_realm;
+        autofill->origin = form.origin;
         autofill->preferred = true;
         autofill->ssl_valid = form.origin.SchemeIsSecure();
         autofill->date_created = info.date_created;
+
         matching_forms.push_back(autofill);
         // Add this PasswordForm to the saved password table. We're on the DB
         // thread already, so we use AddLoginImpl.
@@ -160,10 +163,14 @@ void PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone(
   callback_runner.Run(matched_forms);
 }
 
-PasswordStoreWin::PasswordStoreWin(LoginDatabase* login_database,
-                                   Profile* profile,
-                                   WebDataService* web_data_service)
-    : PasswordStoreDefault(login_database, profile) {
+PasswordStoreWin::PasswordStoreWin(
+    scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
+    scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
+    LoginDatabase* login_database,
+    WebDataService* web_data_service)
+    : PasswordStoreDefault(main_thread_runner,
+                           db_thread_runner,
+                           login_database) {
   db_handler_.reset(new DBHandler(web_data_service, this));
 }
 
@@ -175,11 +182,11 @@ void PasswordStoreWin::ShutdownOnDBThread() {
   db_handler_.reset();
 }
 
-void PasswordStoreWin::ShutdownOnUIThread() {
+void PasswordStoreWin::Shutdown() {
   BrowserThread::PostTask(
       BrowserThread::DB, FROM_HERE,
       base::Bind(&PasswordStoreWin::ShutdownOnDBThread, this));
-  PasswordStoreDefault::ShutdownOnUIThread();
+  PasswordStoreDefault::Shutdown();
 }
 
 void PasswordStoreWin::GetIE7LoginIfNecessary(