| 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_SITE_ENGAGEMENT_SCORE_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| 7 | 7 |
| 8 #include <array> | 8 #include <array> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Get/set the last time this origin recorded an engagement change. | 147 // Get/set the last time this origin recorded an engagement change. |
| 148 base::Time last_engagement_time() const { | 148 base::Time last_engagement_time() const { |
| 149 return last_engagement_time_; | 149 return last_engagement_time_; |
| 150 } | 150 } |
| 151 void set_last_engagement_time(const base::Time& time) { | 151 void set_last_engagement_time(const base::Time& time) { |
| 152 last_engagement_time_ = time; | 152 last_engagement_time_ = time; |
| 153 } | 153 } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, FirstDailyEngagementBonus); |
| 156 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PartiallyEmptyDictionary); | 157 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PartiallyEmptyDictionary); |
| 157 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PopulatedDictionary); | 158 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PopulatedDictionary); |
| 158 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, Reset); | 159 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, Reset); |
| 159 FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, FirstDailyEngagementBonus); | 160 friend class ChromePluginServiceFilterTest; |
| 161 friend class FlashPermissionTestConfig; |
| 160 friend class ImportantSitesUtilTest; | 162 friend class ImportantSitesUtilTest; |
| 161 friend class SiteEngagementHelperTest; | 163 friend class SiteEngagementHelperTest; |
| 162 friend class SiteEngagementScoreTest; | 164 friend class SiteEngagementScoreTest; |
| 163 friend class SiteEngagementServiceTest; | 165 friend class SiteEngagementServiceTest; |
| 164 friend class ChromePluginServiceFilterTest; | |
| 165 | 166 |
| 166 using ParamValues = std::array<std::pair<std::string, double>, MAX_VARIATION>; | 167 using ParamValues = std::array<std::pair<std::string, double>, MAX_VARIATION>; |
| 167 | 168 |
| 168 // Array holding the values corresponding to each item in Variation array. | 169 // Array holding the values corresponding to each item in Variation array. |
| 169 static ParamValues& GetParamValues(); | 170 static ParamValues& GetParamValues(); |
| 170 static ParamValues BuildParamValues(); | 171 static ParamValues BuildParamValues(); |
| 171 | 172 |
| 172 // Keys used in the content settings dictionary. | 173 // Keys used in the content settings dictionary. |
| 173 static const char* kRawScoreKey; | 174 static const char* kRawScoreKey; |
| 174 static const char* kPointsAddedTodayKey; | 175 static const char* kPointsAddedTodayKey; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // The origin this score represents. | 221 // The origin this score represents. |
| 221 GURL origin_; | 222 GURL origin_; |
| 222 | 223 |
| 223 // The settings to write this score to when Commit() is called. | 224 // The settings to write this score to when Commit() is called. |
| 224 HostContentSettingsMap* settings_map_; | 225 HostContentSettingsMap* settings_map_; |
| 225 | 226 |
| 226 DISALLOW_COPY_AND_ASSIGN(SiteEngagementScore); | 227 DISALLOW_COPY_AND_ASSIGN(SiteEngagementScore); |
| 227 }; | 228 }; |
| 228 | 229 |
| 229 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ | 230 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| OLD | NEW |