Commit 570d2fe3 authored by Uladzimir Miniailau's avatar Uladzimir Miniailau Committed by Commit Bot

delete PasswordWebDataService class + related clean-up

AddIE7PasswordInfo method and LoginsTable should also be deleted. I will do it in the following changes.

Bug: 456119
Change-Id: I581fd88bc1fa9bf35d0484616be9d69e939e69ef
Reviewed-on: https://chromium-review.googlesource.com/1174729Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarVaclav Brozek <vabr@chromium.org>
Commit-Queue: Uladzimir Miniailau <miniailau@google.com>
Cr-Commit-Position: refs/heads/master@{#589474}
parent ff4a5a9d
...@@ -174,13 +174,8 @@ void InProcessImporterBridge::AddHomePage(const GURL& home_page) { ...@@ -174,13 +174,8 @@ void InProcessImporterBridge::AddHomePage(const GURL& home_page) {
#if defined(OS_WIN) #if defined(OS_WIN)
void InProcessImporterBridge::AddIE7PasswordInfo( void InProcessImporterBridge::AddIE7PasswordInfo(
const importer::ImporterIE7PasswordInfo& password_info) { const importer::ImporterIE7PasswordInfo&) {
IE7PasswordInfo ie7_password_info; // TODO(crbug.com/456119): delete AddIE7PasswordInfo
ie7_password_info.url_hash = password_info.url_hash;
ie7_password_info.encrypted_data = password_info.encrypted_data;
ie7_password_info.date_created = password_info.date_created;
writer_->AddIE7PasswordInfo(ie7_password_info);
} }
#endif // OS_WIN #endif // OS_WIN
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/favicon/favicon_service_factory.h"
...@@ -36,10 +35,6 @@ ...@@ -36,10 +35,6 @@
#include "components/search_engines/template_url.h" #include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service.h"
#if defined(OS_WIN)
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#endif
using bookmarks::BookmarkModel; using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode; using bookmarks::BookmarkNode;
...@@ -96,13 +91,6 @@ void ProfileWriter::AddPasswordForm(const autofill::PasswordForm& form) { ...@@ -96,13 +91,6 @@ void ProfileWriter::AddPasswordForm(const autofill::PasswordForm& form) {
profile_, ServiceAccessType::EXPLICIT_ACCESS)->AddLogin(form); profile_, ServiceAccessType::EXPLICIT_ACCESS)->AddLogin(form);
} }
#if defined(OS_WIN)
void ProfileWriter::AddIE7PasswordInfo(const IE7PasswordInfo& info) {
WebDataServiceFactory::GetPasswordWebDataForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS)->AddIE7Login(info);
}
#endif
void ProfileWriter::AddHistoryPage(const history::URLRows& page, void ProfileWriter::AddHistoryPage(const history::URLRows& page,
history::VisitSource visit_source) { history::VisitSource visit_source) {
if (!page.empty()) if (!page.empty())
......
...@@ -25,10 +25,6 @@ struct PasswordForm; ...@@ -25,10 +25,6 @@ struct PasswordForm;
class AutofillEntry; class AutofillEntry;
} }
#if defined(OS_WIN)
struct IE7PasswordInfo;
#endif
// ProfileWriter encapsulates profile for writing entries into it. // ProfileWriter encapsulates profile for writing entries into it.
// This object must be invoked on UI thread. // This object must be invoked on UI thread.
class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> {
...@@ -44,10 +40,6 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { ...@@ -44,10 +40,6 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> {
// Helper methods for adding data to local stores. // Helper methods for adding data to local stores.
virtual void AddPasswordForm(const autofill::PasswordForm& form); virtual void AddPasswordForm(const autofill::PasswordForm& form);
#if defined(OS_WIN)
virtual void AddIE7PasswordInfo(const IE7PasswordInfo& info);
#endif
virtual void AddHistoryPage(const history::URLRows& page, virtual void AddHistoryPage(const history::URLRows& page,
history::VisitSource visit_source); history::VisitSource visit_source);
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/browser/password_manager/password_manager_util_win.h" #include "chrome/browser/password_manager/password_manager_util_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"
#elif defined(OS_CHROMEOS) || defined(OS_ANDROID) #elif defined(OS_CHROMEOS) || defined(OS_ANDROID)
......
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
#include "components/webdata_services/web_data_service_wrapper.h" #include "components/webdata_services/web_data_service_wrapper.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#if defined(OS_WIN)
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#endif
using content::BrowserThread; using content::BrowserThread;
namespace { namespace {
...@@ -151,20 +147,6 @@ scoped_refptr<TokenWebData> WebDataServiceFactory::GetTokenWebDataForProfile( ...@@ -151,20 +147,6 @@ scoped_refptr<TokenWebData> WebDataServiceFactory::GetTokenWebDataForProfile(
: scoped_refptr<TokenWebData>(nullptr); : scoped_refptr<TokenWebData>(nullptr);
} }
#if defined(OS_WIN)
// static
scoped_refptr<PasswordWebDataService>
WebDataServiceFactory::GetPasswordWebDataForProfile(
Profile* profile,
ServiceAccessType access_type) {
WebDataServiceWrapper* wrapper =
WebDataServiceFactory::GetForProfile(profile, access_type);
// |wrapper| can be null in Incognito mode.
return wrapper ? wrapper->GetPasswordWebData()
: scoped_refptr<PasswordWebDataService>(nullptr);
}
#endif
// static // static
scoped_refptr<payments::PaymentManifestWebDataService> scoped_refptr<payments::PaymentManifestWebDataService>
WebDataServiceFactory::GetPaymentManifestWebDataForProfile( WebDataServiceFactory::GetPaymentManifestWebDataForProfile(
......
...@@ -21,10 +21,6 @@ class Profile; ...@@ -21,10 +21,6 @@ class Profile;
class TokenWebData; class TokenWebData;
class WebDataServiceWrapper; class WebDataServiceWrapper;
#if defined(OS_WIN)
class PasswordWebDataService;
#endif
namespace payments { namespace payments {
class PaymentManifestWebDataService; class PaymentManifestWebDataService;
} }
...@@ -64,13 +60,6 @@ class WebDataServiceFactory : public BrowserContextKeyedServiceFactory { ...@@ -64,13 +60,6 @@ class WebDataServiceFactory : public BrowserContextKeyedServiceFactory {
Profile* profile, Profile* profile,
ServiceAccessType access_type); ServiceAccessType access_type);
#if defined(OS_WIN)
// Returns the PasswordWebDataService associated with the |profile|.
static scoped_refptr<PasswordWebDataService> GetPasswordWebDataForProfile(
Profile* profile,
ServiceAccessType access_type);
#endif
static scoped_refptr<payments::PaymentManifestWebDataService> static scoped_refptr<payments::PaymentManifestWebDataService>
GetPaymentManifestWebDataForProfile(Profile* profile, GetPaymentManifestWebDataForProfile(Profile* profile,
ServiceAccessType access_type); ServiceAccessType access_type);
......
...@@ -159,8 +159,6 @@ jumbo_static_library("browser") { ...@@ -159,8 +159,6 @@ jumbo_static_library("browser") {
"webdata/logins_table.cc", "webdata/logins_table.cc",
"webdata/logins_table.h", "webdata/logins_table.h",
"webdata/logins_table_win.cc", "webdata/logins_table_win.cc",
"webdata/password_web_data_service_win.cc",
"webdata/password_web_data_service_win.h",
] ]
if (password_reuse_detection_support) { if (password_reuse_detection_support) {
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#include "base/bind.h"
#include "base/single_thread_task_runner.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"
PasswordWebDataService::PasswordWebDataService(
scoped_refptr<WebDatabaseService> wdbs,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
const ProfileErrorCallback& callback)
: WebDataServiceBase(wdbs, callback, ui_task_runner) {}
void PasswordWebDataService::AddIE7Login(const IE7PasswordInfo& info) {
wdbs_->ScheduleDBTask(
FROM_HERE,
base::Bind(&PasswordWebDataService::AddIE7LoginImpl, this, info));
}
void PasswordWebDataService::RemoveIE7Login(const IE7PasswordInfo& info) {
wdbs_->ScheduleDBTask(
FROM_HERE,
base::Bind(&PasswordWebDataService::RemoveIE7LoginImpl, this, info));
}
PasswordWebDataService::Handle PasswordWebDataService::GetIE7Login(
const IE7PasswordInfo& info,
WebDataServiceConsumer* consumer) {
return wdbs_->ScheduleDBTaskWithResult(
FROM_HERE,
base::Bind(&PasswordWebDataService::GetIE7LoginImpl, this, info),
consumer);
}
WebDatabase::State PasswordWebDataService::AddIE7LoginImpl(
const IE7PasswordInfo& info,
WebDatabase* db) {
return LoginsTable::FromWebDatabase(db)->AddIE7Login(info) ?
WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED;
}
WebDatabase::State PasswordWebDataService::RemoveIE7LoginImpl(
const IE7PasswordInfo& info,
WebDatabase* db) {
return LoginsTable::FromWebDatabase(db)->RemoveIE7Login(info) ?
WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED;
}
std::unique_ptr<WDTypedResult> PasswordWebDataService::GetIE7LoginImpl(
const IE7PasswordInfo& info,
WebDatabase* db) {
IE7PasswordInfo result;
LoginsTable::FromWebDatabase(db)->GetIE7Login(info, &result);
return std::unique_ptr<WDTypedResult>(
new WDResult<IE7PasswordInfo>(PASSWORD_IE7_RESULT, result));
}
////////////////////////////////////////////////////////////////////////////////
PasswordWebDataService::PasswordWebDataService(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
: WebDataServiceBase(nullptr, ProfileErrorCallback(), ui_task_runner) {}
PasswordWebDataService::~PasswordWebDataService() {
}
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner_helpers.h"
#include "components/webdata/common/web_data_results.h"
#include "components/webdata/common/web_data_service_base.h"
#include "components/webdata/common/web_data_service_consumer.h"
#include "components/webdata/common/web_database.h"
struct IE7PasswordInfo;
class WebDatabaseService;
namespace base {
class SingleThreadTaskRunner;
}
namespace content {
class BrowserContext;
}
// PasswordWebDataService is used to access IE7/8 Password data stored in the
// web database. All data is retrieved and archived in an asynchronous way.
class WebDataServiceConsumer;
class PasswordWebDataService : public WebDataServiceBase {
public:
// Retrieves a WebDataService for the given context.
static scoped_refptr<PasswordWebDataService> FromBrowserContext(
content::BrowserContext* context);
PasswordWebDataService(
scoped_refptr<WebDatabaseService> wdbs,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
const ProfileErrorCallback& callback);
// Adds |info| to the list of imported passwords from ie7/ie8.
void AddIE7Login(const IE7PasswordInfo& info);
// Removes |info| from the list of imported passwords from ie7/ie8.
void RemoveIE7Login(const IE7PasswordInfo& info);
// Gets the login matching the information in |info|. |consumer| will be
// notified when the request is done. The result is of type
// WDResult<IE7PasswordInfo>.
// If there is no match, the fields of the IE7PasswordInfo will be empty.
// All requests return a handle. The handle can be used to cancel the request.
Handle GetIE7Login(const IE7PasswordInfo& info,
WebDataServiceConsumer* consumer);
protected:
// For unit tests, passes a null callback.
PasswordWebDataService(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
~PasswordWebDataService() override;
private:
// The following methods are only invoked on the DB sequence.
WebDatabase::State AddIE7LoginImpl(const IE7PasswordInfo& info,
WebDatabase* db);
WebDatabase::State RemoveIE7LoginImpl(const IE7PasswordInfo& info,
WebDatabase* db);
std::unique_ptr<WDTypedResult> GetIE7LoginImpl(const IE7PasswordInfo& info,
WebDatabase* db);
DISALLOW_COPY_AND_ASSIGN(PasswordWebDataService);
};
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_
...@@ -32,10 +32,6 @@ ...@@ -32,10 +32,6 @@
#include "components/webdata/common/web_database_service.h" #include "components/webdata/common/web_database_service.h"
#include "components/webdata/common/webdata_constants.h" #include "components/webdata/common/webdata_constants.h"
#if defined(OS_WIN)
#include "components/password_manager/core/browser/webdata/password_web_data_service_win.h"
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
#include "components/payments/content/payment_manifest_web_data_service.h" #include "components/payments/content/payment_manifest_web_data_service.h"
#include "components/payments/content/payment_method_manifest_table.h" #include "components/payments/content/payment_method_manifest_table.h"
...@@ -160,13 +156,6 @@ WebDataServiceWrapper::WebDataServiceWrapper( ...@@ -160,13 +156,6 @@ WebDataServiceWrapper::WebDataServiceWrapper(
base::Bind(show_error_callback, ERROR_LOADING_TOKEN)); base::Bind(show_error_callback, ERROR_LOADING_TOKEN));
token_web_data_->Init(); token_web_data_->Init();
#if defined(OS_WIN)
password_web_data_ = new PasswordWebDataService(
profile_database_, ui_task_runner,
base::Bind(show_error_callback, ERROR_LOADING_PASSWORD));
password_web_data_->Init();
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
payment_manifest_web_data_ = new payments::PaymentManifestWebDataService( payment_manifest_web_data_ = new payments::PaymentManifestWebDataService(
profile_database_, profile_database_,
...@@ -210,10 +199,6 @@ void WebDataServiceWrapper::Shutdown() { ...@@ -210,10 +199,6 @@ void WebDataServiceWrapper::Shutdown() {
keyword_web_data_->ShutdownOnUISequence(); keyword_web_data_->ShutdownOnUISequence();
token_web_data_->ShutdownOnUISequence(); token_web_data_->ShutdownOnUISequence();
#if defined(OS_WIN)
password_web_data_->ShutdownOnUISequence();
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
payment_manifest_web_data_->ShutdownOnUISequence(); payment_manifest_web_data_->ShutdownOnUISequence();
#endif #endif
...@@ -242,13 +227,6 @@ scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { ...@@ -242,13 +227,6 @@ scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() {
return token_web_data_.get(); return token_web_data_.get();
} }
#if defined(OS_WIN)
scoped_refptr<PasswordWebDataService>
WebDataServiceWrapper::GetPasswordWebData() {
return password_web_data_.get();
}
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
scoped_refptr<payments::PaymentManifestWebDataService> scoped_refptr<payments::PaymentManifestWebDataService>
WebDataServiceWrapper::GetPaymentManifestWebData() { WebDataServiceWrapper::GetPaymentManifestWebData() {
......
...@@ -19,10 +19,6 @@ class KeywordWebDataService; ...@@ -19,10 +19,6 @@ class KeywordWebDataService;
class TokenWebData; class TokenWebData;
class WebDatabaseService; class WebDatabaseService;
#if defined(OS_WIN)
class PasswordWebDataService;
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
namespace payments { namespace payments {
class PaymentManifestWebDataService; class PaymentManifestWebDataService;
...@@ -88,9 +84,6 @@ class WebDataServiceWrapper : public KeyedService { ...@@ -88,9 +84,6 @@ class WebDataServiceWrapper : public KeyedService {
GetAccountAutofillWebData(); GetAccountAutofillWebData();
virtual scoped_refptr<KeywordWebDataService> GetKeywordWebData(); virtual scoped_refptr<KeywordWebDataService> GetKeywordWebData();
virtual scoped_refptr<TokenWebData> GetTokenWebData(); virtual scoped_refptr<TokenWebData> GetTokenWebData();
#if defined(OS_WIN)
virtual scoped_refptr<PasswordWebDataService> GetPasswordWebData();
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
virtual scoped_refptr<payments::PaymentManifestWebDataService> virtual scoped_refptr<payments::PaymentManifestWebDataService>
GetPaymentManifestWebData(); GetPaymentManifestWebData();
...@@ -109,10 +102,6 @@ class WebDataServiceWrapper : public KeyedService { ...@@ -109,10 +102,6 @@ class WebDataServiceWrapper : public KeyedService {
scoped_refptr<KeywordWebDataService> keyword_web_data_; scoped_refptr<KeywordWebDataService> keyword_web_data_;
scoped_refptr<TokenWebData> token_web_data_; scoped_refptr<TokenWebData> token_web_data_;
#if defined(OS_WIN)
scoped_refptr<PasswordWebDataService> password_web_data_;
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
scoped_refptr<payments::PaymentManifestWebDataService> scoped_refptr<payments::PaymentManifestWebDataService>
payment_manifest_web_data_; payment_manifest_web_data_;
......
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