| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ |
| 6 #define CHROME_BROWSER_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace user_prefs { | 16 namespace user_prefs { |
| 17 class PrefRegistrySyncable; | 17 class PrefRegistrySyncable; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class ImportantSitesUtil { | 20 class ImportantSitesUtil { |
| 21 public: | 21 public: |
| 22 struct ImportantDomainInfo { | 22 struct ImportantDomainInfo { |
| 23 std::string registerable_domain; | 23 std::string registerable_domain; |
| 24 GURL example_origin; | 24 GURL example_origin; |
| 25 double engagement_score = 0; | 25 double engagement_score = 0; |
| 26 int32_t reason_bitfield = 0; | 26 int32_t reason_bitfield = 0; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 static bool HasNotifications(const ImportantDomainInfo& info); |
| 30 |
| 29 static bool IsDialogDisabled(Profile* profile); | 31 static bool IsDialogDisabled(Profile* profile); |
| 30 | 32 |
| 31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 33 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 32 | 34 |
| 33 // This returns the top |<=max_results| important registrable domains. This | 35 // This returns the top |<=max_results| important registrable domains. This |
| 34 // uses site engagement and notifications to generate the list. |max_results| | 36 // uses site engagement and notifications to generate the list. |max_results| |
| 35 // is assumed to be small. | 37 // is assumed to be small. |
| 36 // See net/base/registry_controlled_domains/registry_controlled_domain.h for | 38 // See net/base/registry_controlled_domains/registry_controlled_domain.h for |
| 37 // more details on registrable domains and the current list of effective | 39 // more details on registrable domains and the current list of effective |
| 38 // eTLDs. | 40 // eTLDs. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 57 // the score requirements for the Site Engagement Service, so ONLY call for | 59 // the score requirements for the Site Engagement Service, so ONLY call for |
| 58 // testing. | 60 // testing. |
| 59 static void MarkOriginAsImportantForTesting(Profile* profile, | 61 static void MarkOriginAsImportantForTesting(Profile* profile, |
| 60 const GURL& origin); | 62 const GURL& origin); |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(ImportantSitesUtil); | 65 DISALLOW_IMPLICIT_CONSTRUCTORS(ImportantSitesUtil); |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 #endif // CHROME_BROWSER_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ | 68 #endif // CHROME_BROWSER_ENGAGEMENT_IMPORTANT_SITES_UTIL_H_ |
| OLD | NEW |