Commit b646c85e authored by caitkp@chromium.org's avatar caitkp@chromium.org

Move Password specific webdata logic into passwords component.


BUG=181277
TEST=Everything still works
TBR=shess@chromium.org, gab@chromium.org
(shess@ for logins_table, gab@ for profile_writer both file-moves)

Review URL: https://codereview.chromium.org/380023002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283658 0039d316-1c4b-4281-b951-d872f2087c98
parent 14db34f1
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/browser/webdata/password_web_data_service_win.h"
#include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/browser/webdata/web_data_service_factory.h"
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#endif #endif
namespace { namespace {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/browser/password_manager/password_store_win.h" #include "chrome/browser/password_manager/password_store_win.h"
#include "chrome/browser/webdata/password_web_data_service_win.h" #include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include "chrome/browser/password_manager/password_store_mac.h" #include "chrome/browser/password_manager/password_store_mac.h"
#include "crypto/apple_keychain.h" #include "crypto/apple_keychain.h"
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/webdata/password_web_data_service_win.h"
#include "components/os_crypt/ie7_password_win.h" #include "components/os_crypt/ie7_password_win.h"
#include "components/password_manager/core/browser/password_manager.h" #include "components/password_manager/core/browser/password_manager.h"
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
using autofill::PasswordForm; using autofill::PasswordForm;
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/password_manager/password_store_win.h" #include "chrome/browser/password_manager/password_store_win.h"
#include "chrome/browser/webdata/logins_table.h"
#include "chrome/browser/webdata/password_web_data_service_win.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "components/os_crypt/ie7_password_win.h" #include "components/os_crypt/ie7_password_win.h"
#include "components/password_manager/core/browser/password_form_data.h" #include "components/password_manager/core/browser/password_form_data.h"
#include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_store_consumer.h"
#include "components/password_manager/core/browser/webdata/logins_table.h"
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/webdata/common/web_database_service.h" #include "components/webdata/common/web_database_service.h"
#include "content/public/test/test_browser_thread.h" #include "content/public/test/test_browser_thread.h"
...@@ -126,7 +126,9 @@ class PasswordStoreWinTest : public testing::Test { ...@@ -126,7 +126,9 @@ class PasswordStoreWinTest : public testing::Test {
wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable()));
wdbs_->LoadDatabase(); wdbs_->LoadDatabase();
wds_ = new PasswordWebDataService( wds_ = new PasswordWebDataService(
wdbs_, WebDataServiceBase::ProfileErrorCallback()); wdbs_,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
WebDataServiceBase::ProfileErrorCallback());
wds_->Init(); wds_->Init();
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "chrome/browser/sync/glue/sync_start_util.h" #include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/ui/profile_error_dialog.h" #include "chrome/browser/ui/profile_error_dialog.h"
#include "chrome/browser/webdata/autocomplete_syncable_service.h" #include "chrome/browser/webdata/autocomplete_syncable_service.h"
#include "chrome/browser/webdata/logins_table.h"
#include "chrome/browser/webdata/web_apps_table.h" #include "chrome/browser/webdata/web_apps_table.h"
#include "chrome/browser/webdata/web_intents_table.h" #include "chrome/browser/webdata/web_intents_table.h"
#include "components/autofill/core/browser/autofill_country.h" #include "components/autofill/core/browser/autofill_country.h"
...@@ -19,6 +18,7 @@ ...@@ -19,6 +18,7 @@
#include "components/autofill/core/browser/webdata/autofill_table.h" #include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/password_manager/core/browser/webdata/logins_table.h"
#include "components/search_engines/keyword_table.h" #include "components/search_engines/keyword_table.h"
#include "components/search_engines/keyword_web_data_service.h" #include "components/search_engines/keyword_web_data_service.h"
#include "components/signin/core/browser/webdata/token_service_table.h" #include "components/signin/core/browser/webdata/token_service_table.h"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/browser/webdata/password_web_data_service_win.h" #include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#endif #endif
using autofill::AutofillWebDataService; using autofill::AutofillWebDataService;
...@@ -125,6 +125,7 @@ WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { ...@@ -125,6 +125,7 @@ WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) {
#if defined(OS_WIN) #if defined(OS_WIN)
password_web_data_ = new PasswordWebDataService( password_web_data_ = new PasswordWebDataService(
web_database_, web_database_,
ui_thread,
base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_WEB_DATA)); base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_WEB_DATA));
password_web_data_->Init(); password_web_data_->Init();
#endif #endif
......
...@@ -1433,11 +1433,6 @@ ...@@ -1433,11 +1433,6 @@
'browser/web_resource/web_resource_service.h', 'browser/web_resource/web_resource_service.h',
'browser/webdata/autocomplete_syncable_service.cc', 'browser/webdata/autocomplete_syncable_service.cc',
'browser/webdata/autocomplete_syncable_service.h', 'browser/webdata/autocomplete_syncable_service.h',
'browser/webdata/logins_table.cc',
'browser/webdata/logins_table.h',
'browser/webdata/logins_table_win.cc',
'browser/webdata/password_web_data_service_win.cc',
'browser/webdata/password_web_data_service_win.h',
'browser/webdata/web_apps_table.cc', 'browser/webdata/web_apps_table.cc',
'browser/webdata/web_apps_table.h', 'browser/webdata/web_apps_table.h',
'browser/webdata/web_data_service_factory.cc', 'browser/webdata/web_data_service_factory.cc',
......
...@@ -60,6 +60,11 @@ ...@@ -60,6 +60,11 @@
'password_manager/core/browser/password_store_sync.h', 'password_manager/core/browser/password_store_sync.h',
'password_manager/core/browser/psl_matching_helper.cc', 'password_manager/core/browser/psl_matching_helper.cc',
'password_manager/core/browser/psl_matching_helper.h', 'password_manager/core/browser/psl_matching_helper.h',
'password_manager/core/browser/webdata/logins_table.cc',
'password_manager/core/browser/webdata/logins_table.h',
'password_manager/core/browser/webdata/logins_table_win.cc',
'password_manager/core/browser/webdata/password_web_data_service_win.cc',
'password_manager/core/browser/webdata/password_web_data_service_win.h',
], ],
'variables': { 'variables': {
'conditions': [ 'conditions': [
......
...@@ -2,5 +2,6 @@ include_rules = [ ...@@ -2,5 +2,6 @@ include_rules = [
"+components/autofill/core/browser", "+components/autofill/core/browser",
"+components/keyed_service/core", "+components/keyed_service/core",
"+components/pref_registry", "+components/pref_registry",
"+components/webdata/common",
"+google_apis", "+google_apis",
] ]
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/webdata/logins_table.h" #include "components/password_manager/core/browser/webdata/logins_table.h"
#include <limits> #include <limits>
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_ #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_LOGINS_TABLE_H_
#define CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_LOGINS_TABLE_H_
#include <vector> #include <vector>
...@@ -49,4 +49,4 @@ class LoginsTable : public WebDatabaseTable { ...@@ -49,4 +49,4 @@ class LoginsTable : public WebDatabaseTable {
DISALLOW_COPY_AND_ASSIGN(LoginsTable); DISALLOW_COPY_AND_ASSIGN(LoginsTable);
}; };
#endif // CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_ #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_LOGINS_TABLE_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/webdata/logins_table.h" #include "components/password_manager/core/browser/webdata/logins_table.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
......
...@@ -2,22 +2,19 @@ ...@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/webdata/password_web_data_service_win.h" #include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#include "base/bind.h" #include "base/bind.h"
#include "chrome/browser/webdata/logins_table.h" #include "base/message_loop/message_loop_proxy.h"
#include "components/os_crypt/ie7_password_win.h" #include "components/os_crypt/ie7_password_win.h"
#include "components/password_manager/core/browser/webdata/logins_table.h"
#include "components/webdata/common/web_database_service.h" #include "components/webdata/common/web_database_service.h"
#include "content/public/browser/browser_thread.h"
PasswordWebDataService::PasswordWebDataService( PasswordWebDataService::PasswordWebDataService(
scoped_refptr<WebDatabaseService> wdbs, scoped_refptr<WebDatabaseService> wdbs,
scoped_refptr<base::MessageLoopProxy> ui_thread,
const ProfileErrorCallback& callback) const ProfileErrorCallback& callback)
: WebDataServiceBase( : WebDataServiceBase(wdbs, callback, ui_thread) {
wdbs,
callback,
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::UI)) {
} }
void PasswordWebDataService::AddIE7Login(const IE7PasswordInfo& info) { void PasswordWebDataService::AddIE7Login(const IE7PasswordInfo& info) {
...@@ -66,12 +63,9 @@ scoped_ptr<WDTypedResult> PasswordWebDataService::GetIE7LoginImpl( ...@@ -66,12 +63,9 @@ scoped_ptr<WDTypedResult> PasswordWebDataService::GetIE7LoginImpl(
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
PasswordWebDataService::PasswordWebDataService() PasswordWebDataService::PasswordWebDataService(
: WebDataServiceBase( scoped_refptr<base::MessageLoopProxy> ui_thread)
NULL, : WebDataServiceBase(NULL, ProfileErrorCallback(), ui_thread) {
ProfileErrorCallback(),
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::UI)) {
} }
PasswordWebDataService::~PasswordWebDataService() { PasswordWebDataService::~PasswordWebDataService() {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
#define CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
#include <vector> #include <vector>
...@@ -20,6 +20,7 @@ class Profile; ...@@ -20,6 +20,7 @@ class Profile;
class WebDatabaseService; class WebDatabaseService;
namespace base { namespace base {
class MessageLoopProxy;
class Thread; class Thread;
} }
...@@ -39,6 +40,7 @@ class PasswordWebDataService : public WebDataServiceBase { ...@@ -39,6 +40,7 @@ class PasswordWebDataService : public WebDataServiceBase {
content::BrowserContext* context); content::BrowserContext* context);
PasswordWebDataService(scoped_refptr<WebDatabaseService> wdbs, PasswordWebDataService(scoped_refptr<WebDatabaseService> wdbs,
scoped_refptr<base::MessageLoopProxy> ui_thread,
const ProfileErrorCallback& callback); const ProfileErrorCallback& callback);
// Adds |info| to the list of imported passwords from ie7/ie8. // Adds |info| to the list of imported passwords from ie7/ie8.
...@@ -57,7 +59,7 @@ class PasswordWebDataService : public WebDataServiceBase { ...@@ -57,7 +59,7 @@ class PasswordWebDataService : public WebDataServiceBase {
protected: protected:
// For unit tests, passes a null callback. // For unit tests, passes a null callback.
PasswordWebDataService(); PasswordWebDataService(scoped_refptr<base::MessageLoopProxy> ui_thread);
virtual ~PasswordWebDataService(); virtual ~PasswordWebDataService();
...@@ -73,4 +75,4 @@ class PasswordWebDataService : public WebDataServiceBase { ...@@ -73,4 +75,4 @@ class PasswordWebDataService : public WebDataServiceBase {
DISALLOW_COPY_AND_ASSIGN(PasswordWebDataService); DISALLOW_COPY_AND_ASSIGN(PasswordWebDataService);
}; };
#endif // CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
...@@ -15,6 +15,7 @@ specific_include_rules = { ...@@ -15,6 +15,7 @@ specific_include_rules = {
"+chrome/browser/webdata/web_data_service_factory.h", "+chrome/browser/webdata/web_data_service_factory.h",
"+chrome/browser/webdata/web_intents_table.h", "+chrome/browser/webdata/web_intents_table.h",
"+components/autofill/core", "+components/autofill/core",
"+components/password_manager/core/browser/webdata",
"+components/search_engines/keyword_table.h", "+components/search_engines/keyword_table.h",
"+components/signin/core/browser/webdata", "+components/signin/core/browser/webdata",
"+content/public/test", "+content/public/test",
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/webdata/logins_table.h"
#include "chrome/browser/webdata/web_apps_table.h" #include "chrome/browser/webdata/web_apps_table.h"
#include "chrome/browser/webdata/web_intents_table.h" #include "chrome/browser/webdata/web_intents_table.h"
#include "components/autofill/core/browser/autofill_country.h" #include "components/autofill/core/browser/autofill_country.h"
...@@ -26,6 +25,7 @@ ...@@ -26,6 +25,7 @@
#include "components/autofill/core/browser/webdata/autofill_change.h" #include "components/autofill/core/browser/webdata/autofill_change.h"
#include "components/autofill/core/browser/webdata/autofill_entry.h" #include "components/autofill/core/browser/webdata/autofill_entry.h"
#include "components/autofill/core/browser/webdata/autofill_table.h" #include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/password_manager/core/browser/webdata/logins_table.h"
#include "components/search_engines/keyword_table.h" #include "components/search_engines/keyword_table.h"
#include "components/signin/core/browser/webdata/token_service_table.h" #include "components/signin/core/browser/webdata/token_service_table.h"
#include "components/webdata/common/web_database.h" #include "components/webdata/common/web_database.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment