| Index: chrome/browser/engagement/site_engagement_score.h
|
| diff --git a/chrome/browser/engagement/site_engagement_score.h b/chrome/browser/engagement/site_engagement_score.h
|
| index 358f97d6cf79dfcee6ac4703bc3b7c15b3654758..c686e8a5c6db8446ac1185c0c3b46bac8e7c1afc 100644
|
| --- a/chrome/browser/engagement/site_engagement_score.h
|
| +++ b/chrome/browser/engagement/site_engagement_score.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/macros.h"
|
| #include "base/time/time.h"
|
| #include "base/values.h"
|
| +#include "chrome/browser/engagement/site_engagement_details.mojom.h"
|
| #include "third_party/WebKit/public/platform/site_engagement.mojom.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -137,7 +138,15 @@ class SiteEngagementScore {
|
| // possible score. Decays the score if it has not been updated recently
|
| // enough.
|
| void AddPoints(double points);
|
| - double GetScore() const;
|
| +
|
| + // Returns the total score, taking into account the base, bonus and maximum
|
| + // values.
|
| + double GetTotalScore() const;
|
| +
|
| + // Returns a structure containing the origin URL and score, and details
|
| + // of the base and bonus scores. Note that the |score| is limited to
|
| + // kMaxPoints, while the detailed scores are returned raw.
|
| + mojom::SiteEngagementDetails GetDetails() const;
|
|
|
| // Writes the values in this score into |settings_map_|.
|
| void Commit();
|
| @@ -152,6 +161,9 @@ class SiteEngagementScore {
|
| // |updated_time| is non-null, sets the last engagement time to that value.
|
| void Reset(double points, const base::Time updated_time);
|
|
|
| + // Returns the raw, un-decayed score, without bonuses applied.
|
| + double raw_score() { return raw_score_; }
|
| +
|
| // Get/set the last time this origin was launched from an installed shortcut.
|
| base::Time last_shortcut_launch_time() const {
|
| return last_shortcut_launch_time_;
|
| @@ -196,8 +208,11 @@ class SiteEngagementScore {
|
| // Determine the score, accounting for any decay.
|
| double DecayedScore() const;
|
|
|
| - // Determine any score bonus from having installed shortcuts.
|
| - double BonusScore() const;
|
| + // Determine bonus from being installed, and having been launched recently..
|
| + double BonusIfShortcutLaunched() const;
|
| +
|
| + // Determine bonus from having been granted notifications permission.
|
| + double BonusIfHasNotifications() const;
|
|
|
| // Updates the content settings dictionary |score_dict| with the current score
|
| // fields. Returns true if |score_dict| changed, otherwise return false.
|
|
|