Chromium Code Reviews| 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 #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 safe_browsing { | 12 namespace safe_browsing { |
| 13 | 13 |
| 14 class SafeBrowsingService; | 14 class SafeBrowsingService; |
| 15 class SafeBrowsingNavigationObserverManager; | 15 class SafeBrowsingNavigationObserverManager; |
| 16 | 16 |
| 17 // ChromePasswordProtectionService extends PasswordProtectionService by adding | 17 // ChromePasswordProtectionService extends PasswordProtectionService by adding |
| 18 // access to SafeBrowsingNaivigationObserverManager and Profile. | 18 // access to SafeBrowsingNaivigationObserverManager and Profile. |
| 19 class ChromePasswordProtectionService : public PasswordProtectionService { | 19 class ChromePasswordProtectionService : public PasswordProtectionService { |
| 20 public: | 20 public: |
| 21 ChromePasswordProtectionService(SafeBrowsingService* sb_service, | 21 ChromePasswordProtectionService(SafeBrowsingService* sb_service, |
| 22 Profile* profile); | 22 Profile* profile); |
| 23 | 23 |
| 24 ~ChromePasswordProtectionService() override; | 24 ~ChromePasswordProtectionService() override; |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 FRIEND_TEST_ALL_PREFIXES( | |
|
Nathan Parker
2017/05/05 20:58:21
nit: put these at the end of the protected (or pri
Jialiu Lin
2017/05/05 22:19:32
Done.
| |
| 28 ChromePasswordProtectionServiceTest, | |
| 29 VerifyFinchControlForLowReputationPingSBEROnlyNoIncognito); | |
| 30 FRIEND_TEST_ALL_PREFIXES( | |
| 31 ChromePasswordProtectionServiceTest, | |
| 32 VerifyFinchControlForLowReputationPingSBERAndHistorySyncNoIncognito); | |
| 33 FRIEND_TEST_ALL_PREFIXES(ChromePasswordProtectionServiceTest, | |
| 34 VerifyFinchControlForLowReputationPingAll); | |
| 27 // PasswordProtectionService overrides. | 35 // PasswordProtectionService overrides. |
| 28 // Obtains referrer chain of |event_url| and |event_tab_id| and add this | 36 // Obtains referrer chain of |event_url| and |event_tab_id| and add this |
| 29 // info into |frame|. | 37 // info into |frame|. |
| 30 void FillReferrerChain(const GURL& event_url, | 38 void FillReferrerChain(const GURL& event_url, |
| 31 int event_tab_id, | 39 int event_tab_id, |
| 32 LoginReputationClientRequest::Frame* frame) override; | 40 LoginReputationClientRequest::Frame* frame) override; |
| 33 | 41 |
| 34 bool IsExtendedReporting() override; | 42 bool IsExtendedReporting() override; |
| 35 | 43 |
| 36 bool IsIncognito() override; | 44 bool IsIncognito() override; |
| 37 | 45 |
| 38 // Checks if Finch config allows sending pings to Safe Browsing backend. | 46 // Checks if Finch config allows sending pings to Safe Browsing Server. |
| 39 bool IsPingingEnabled() override; | 47 bool IsPingingEnabled(const base::Feature& feature) override; |
|
Nathan Parker
2017/05/05 20:58:21
What is |feature| here? Maybe add a comment or na
Jialiu Lin
2017/05/05 22:19:32
Feature can be either kLowReputationPinging or kPr
| |
| 48 | |
| 49 // If user enabled history syncing. | |
| 50 bool IsHistorySyncEnabled() override; | |
| 40 | 51 |
| 41 private: | 52 private: |
| 53 friend class MockChromePasswordProtectionService; | |
| 54 // Default constructor used for tests only. | |
| 55 ChromePasswordProtectionService(); | |
| 42 // Profile associated with this instance. | 56 // Profile associated with this instance. |
| 43 Profile* profile_; | 57 Profile* profile_; |
| 44 scoped_refptr<SafeBrowsingNavigationObserverManager> | 58 scoped_refptr<SafeBrowsingNavigationObserverManager> |
| 45 navigation_observer_manager_; | 59 navigation_observer_manager_; |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromePasswordProtectionService); | 60 DISALLOW_COPY_AND_ASSIGN(ChromePasswordProtectionService); |
| 47 }; | 61 }; |
| 48 | 62 |
| 49 } // namespace safe_browsing | 63 } // namespace safe_browsing |
| 50 | 64 |
| 51 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_ | 65 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_PASSWORD_PROTECTION_SERVICE_H_ |
| OLD | NEW |