OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_SAFE_BROWSING_PASSWORD_PROTECTION_PASSWORD_PROTECTION_SERVICE
_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_PASSWORD_PROTECTION_PASSWORD_PROTECTION_SERVICE
_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 |
| 12 class GURL; |
| 13 |
| 14 namespace safe_browsing { |
| 15 |
| 16 class SafeBrowsingDatabaseManager; |
| 17 |
| 18 class PasswordProtectionService { |
| 19 public: |
| 20 explicit PasswordProtectionService( |
| 21 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager); |
| 22 |
| 23 virtual ~PasswordProtectionService(); |
| 24 |
| 25 // Check if |url| matches CSD whitelist and record UMA metric accordingly. |
| 26 // Currently called by PasswordReuseDetectionManager on UI thread. |
| 27 void RecordPasswordReuse(const GURL& url); |
| 28 |
| 29 base::WeakPtr<PasswordProtectionService> GetWeakPtr() { |
| 30 return weak_factory_.GetWeakPtr(); |
| 31 } |
| 32 |
| 33 protected: |
| 34 // Called on UI thread. |
| 35 // Increases "PasswordManager.PasswordReuse.MainFrameMatchCsdWhitelist" UMA |
| 36 // metric based on input. |
| 37 void OnMatchCsdWhiteListResult(bool match_whitelist); |
| 38 |
| 39 private: |
| 40 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
| 41 base::WeakPtrFactory<PasswordProtectionService> weak_factory_; |
| 42 DISALLOW_COPY_AND_ASSIGN(PasswordProtectionService); |
| 43 }; |
| 44 |
| 45 } // namespace safe_browsing |
| 46 |
| 47 #endif // COMPONENTS_SAFE_BROWSING_PASSWORD_PROTECTION_PASSWORD_PROTECTION_SERV
ICE_H_ |
OLD | NEW |