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

Side by Side Diff: chrome/browser/safe_browsing/chrome_password_protection_service.h

Issue 2905343002: Show interstitial on a password on focus ping with PHISHING verdict. (Closed)
Patch Set: nit 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 unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_
7 7
8 #include "components/safe_browsing/password_protection/password_protection_servi ce.h" 8 #include "components/safe_browsing/password_protection/password_protection_servi ce.h"
9 9
10 class Profile; 10 class Profile;
11 11
12 namespace content {
13 class WebContents;
14 }
15
12 namespace safe_browsing { 16 namespace safe_browsing {
13 17
14 class SafeBrowsingService; 18 class SafeBrowsingService;
15 class SafeBrowsingNavigationObserverManager; 19 class SafeBrowsingNavigationObserverManager;
20 class SafeBrowsingUIManager;
16 21
17 // ChromePasswordProtectionService extends PasswordProtectionService by adding 22 // ChromePasswordProtectionService extends PasswordProtectionService by adding
18 // access to SafeBrowsingNaivigationObserverManager and Profile. 23 // access to SafeBrowsingNaivigationObserverManager and Profile.
19 class ChromePasswordProtectionService : public PasswordProtectionService { 24 class ChromePasswordProtectionService : public PasswordProtectionService {
20 public: 25 public:
21 ChromePasswordProtectionService(SafeBrowsingService* sb_service, 26 ChromePasswordProtectionService(SafeBrowsingService* sb_service,
22 Profile* profile); 27 Profile* profile);
23 28
24 ~ChromePasswordProtectionService() override; 29 ~ChromePasswordProtectionService() override;
25 30
(...skipping 12 matching lines...) Expand all
38 // Checks if Finch config allows sending pings to Safe Browsing Server. 43 // Checks if Finch config allows sending pings to Safe Browsing Server.
39 // If not, indicated its reason by modifying |reason|. 44 // If not, indicated its reason by modifying |reason|.
40 // |feature| should be either kLowReputationPinging or 45 // |feature| should be either kLowReputationPinging or
41 // kProtectedPasswordEntryPinging. 46 // kProtectedPasswordEntryPinging.
42 bool IsPingingEnabled(const base::Feature& feature, 47 bool IsPingingEnabled(const base::Feature& feature,
43 RequestOutcome* reason) override; 48 RequestOutcome* reason) override;
44 49
45 // If user enabled history syncing. 50 // If user enabled history syncing.
46 bool IsHistorySyncEnabled() override; 51 bool IsHistorySyncEnabled() override;
47 52
53 void ShowPhishingInterstitial(const GURL& phishing_url,
54 const std::string& token,
55 content::WebContents* web_contents) override;
56
48 FRIEND_TEST_ALL_PREFIXES( 57 FRIEND_TEST_ALL_PREFIXES(
49 ChromePasswordProtectionServiceTest, 58 ChromePasswordProtectionServiceTest,
50 VerifyFinchControlForLowReputationPingSBEROnlyNoIncognito); 59 VerifyFinchControlForLowReputationPingSBEROnlyNoIncognito);
51 FRIEND_TEST_ALL_PREFIXES( 60 FRIEND_TEST_ALL_PREFIXES(
52 ChromePasswordProtectionServiceTest, 61 ChromePasswordProtectionServiceTest,
53 VerifyFinchControlForLowReputationPingSBERAndHistorySyncNoIncognito); 62 VerifyFinchControlForLowReputationPingSBERAndHistorySyncNoIncognito);
54 FRIEND_TEST_ALL_PREFIXES(ChromePasswordProtectionServiceTest, 63 FRIEND_TEST_ALL_PREFIXES(ChromePasswordProtectionServiceTest,
55 VerifyFinchControlForLowReputationPingAll); 64 VerifyFinchControlForLowReputationPingAll);
56 FRIEND_TEST_ALL_PREFIXES( 65 FRIEND_TEST_ALL_PREFIXES(
57 ChromePasswordProtectionServiceTest, 66 ChromePasswordProtectionServiceTest,
58 VerifyFinchControlForLowReputationPingAllButNoIncognito); 67 VerifyFinchControlForLowReputationPingAllButNoIncognito);
59 68
60 private: 69 private:
61 friend class MockChromePasswordProtectionService; 70 friend class MockChromePasswordProtectionService;
62 // Default constructor used for tests only. 71 // Constructor used for tests only.
63 ChromePasswordProtectionService(); 72 explicit ChromePasswordProtectionService(Profile* profile);
73
74 scoped_refptr<SafeBrowsingUIManager> ui_manager_;
64 // Profile associated with this instance. 75 // Profile associated with this instance.
65 Profile* profile_; 76 Profile* profile_;
66 scoped_refptr<SafeBrowsingNavigationObserverManager> 77 scoped_refptr<SafeBrowsingNavigationObserverManager>
67 navigation_observer_manager_; 78 navigation_observer_manager_;
68 DISALLOW_COPY_AND_ASSIGN(ChromePasswordProtectionService); 79 DISALLOW_COPY_AND_ASSIGN(ChromePasswordProtectionService);
69 }; 80 };
70 81
71 } // namespace safe_browsing 82 } // namespace safe_browsing
72 83
73 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_ 84 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698