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

Side by Side Diff: components/safe_browsing/password_protection/password_protection_service.h

Issue 2720643003: Call CSD whitelist checking on UI thread and record UMA (Closed)
Patch Set: change source_set name Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698