| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" | 5 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" |
| 6 | 6 |
| 7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/metrics/field_trial_params.h" | 8 #include "base/metrics/field_trial_params.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 profile, | 37 profile, |
| 38 ServiceAccessType::EXPLICIT_ACCESS), | 38 ServiceAccessType::EXPLICIT_ACCESS), |
| 39 HostContentSettingsMapFactory::GetForProfile(profile)), | 39 HostContentSettingsMapFactory::GetForProfile(profile)), |
| 40 profile_(profile), | 40 profile_(profile), |
| 41 navigation_observer_manager_(sb_service->navigation_observer_manager()) { | 41 navigation_observer_manager_(sb_service->navigation_observer_manager()) { |
| 42 DCHECK(profile_); | 42 DCHECK(profile_); |
| 43 } | 43 } |
| 44 | 44 |
| 45 ChromePasswordProtectionService::~ChromePasswordProtectionService() { | 45 ChromePasswordProtectionService::~ChromePasswordProtectionService() { |
| 46 if (content_settings()) { | 46 if (content_settings()) { |
| 47 CleanUpExpiredVerdicts(); |
| 47 UMA_HISTOGRAM_COUNTS_1000( | 48 UMA_HISTOGRAM_COUNTS_1000( |
| 48 "PasswordProtection.NumberOfCachedVerdictBeforeShutdown", | 49 "PasswordProtection.NumberOfCachedVerdictBeforeShutdown", |
| 49 GetStoredVerdictCount()); | 50 GetStoredVerdictCount()); |
| 50 } | 51 } |
| 51 } | 52 } |
| 52 | 53 |
| 53 void ChromePasswordProtectionService::FillReferrerChain( | 54 void ChromePasswordProtectionService::FillReferrerChain( |
| 54 const GURL& event_url, | 55 const GURL& event_url, |
| 55 int event_tab_id, | 56 int event_tab_id, |
| 56 LoginReputationClientRequest::Frame* frame) { | 57 LoginReputationClientRequest::Frame* frame) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool ChromePasswordProtectionService::IsHistorySyncEnabled() { | 109 bool ChromePasswordProtectionService::IsHistorySyncEnabled() { |
| 109 browser_sync::ProfileSyncService* sync = | 110 browser_sync::ProfileSyncService* sync = |
| 110 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); | 111 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); |
| 111 return sync && sync->IsSyncActive() && !sync->IsLocalSyncEnabled() && | 112 return sync && sync->IsSyncActive() && !sync->IsLocalSyncEnabled() && |
| 112 sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); | 113 sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); |
| 113 } | 114 } |
| 114 | 115 |
| 115 ChromePasswordProtectionService::ChromePasswordProtectionService() | 116 ChromePasswordProtectionService::ChromePasswordProtectionService() |
| 116 : PasswordProtectionService(nullptr, nullptr, nullptr, nullptr) {} | 117 : PasswordProtectionService(nullptr, nullptr, nullptr, nullptr) {} |
| 117 } // namespace safe_browsing | 118 } // namespace safe_browsing |
| OLD | NEW |