Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 2912383004: Fill is_chrome_signin_password field in the password entry pings. (Closed)
Patch Set: address nparker's comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 72d4baa26e375c564fda5bad6deffe6e1f0ee685..bf6795ad76aa499e830a341fff707085e4c2267b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
#include "chrome/browser/safe_browsing/ping_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
@@ -71,6 +70,7 @@
#include "chrome/browser/safe_browsing/incident_reporting/resource_request_detector.h"
#include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_analyzer.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
+#include "components/safe_browsing/password_protection/password_protection_service.h"
#endif
using content::BrowserThread;
@@ -208,9 +208,6 @@ void SafeBrowsingService::ShutDown() {
// observer of the preferences.
prefs_map_.clear();
- // Delete the ChromePasswordProtectionService instances.
- password_protection_service_map_.clear();
-
Stop(true);
services_delegate_->ShutdownServices();
@@ -297,10 +294,7 @@ TriggerManager* SafeBrowsingService::trigger_manager() const {
PasswordProtectionService* SafeBrowsingService::GetPasswordProtectionService(
Profile* profile) const {
- DCHECK(profile);
- auto it = password_protection_service_map_.find(profile);
- DCHECK(it != password_protection_service_map_.end());
- return it->second.get();
+ return services_delegate_->GetPasswordProtectionService(profile);
}
std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate>
@@ -502,7 +496,7 @@ void SafeBrowsingService::Observe(int type,
case chrome::NOTIFICATION_PROFILE_CREATED: {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = content::Source<Profile>(source).ptr();
- CreatePasswordProtectionService(profile);
+ services_delegate_->CreatePasswordProtectionService(profile);
if (!profile->IsOffTheRecord())
AddPrefService(profile->GetPrefs());
break;
@@ -510,7 +504,7 @@ void SafeBrowsingService::Observe(int type,
case chrome::NOTIFICATION_PROFILE_DESTROYED: {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = content::Source<Profile>(source).ptr();
- RemovePasswordProtectionService(profile);
+ services_delegate_->RemovePasswordProtectionService(profile);
if (!profile->IsOffTheRecord())
RemovePrefService(profile->GetPrefs());
break;
@@ -621,24 +615,6 @@ void SafeBrowsingService::ProcessResourceRequest(
services_delegate_->ProcessResourceRequest(&request);
}
-void SafeBrowsingService::CreatePasswordProtectionService(Profile* profile) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(profile);
- auto it = password_protection_service_map_.find(profile);
- DCHECK(it == password_protection_service_map_.end());
- std::unique_ptr<ChromePasswordProtectionService> service =
- base::MakeUnique<ChromePasswordProtectionService>(this, profile);
- password_protection_service_map_[profile] = std::move(service);
-}
-
-void SafeBrowsingService::RemovePasswordProtectionService(Profile* profile) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(profile);
- auto it = password_protection_service_map_.find(profile);
- if (it != password_protection_service_map_.end())
- password_protection_service_map_.erase(it);
-}
-
void SafeBrowsingService::CreateTriggerManager() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
trigger_manager_ = base::MakeUnique<TriggerManager>(ui_manager_.get());
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/safe_browsing/services_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698