| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ |
| 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 base::Time time); | 138 base::Time time); |
| 139 | 139 |
| 140 // Returns true if any site under |origin| was launched from homescreen in the | 140 // Returns true if any site under |origin| was launched from homescreen in the |
| 141 // last ten days. This allows services outside app banners to utilise the | 141 // last ten days. This allows services outside app banners to utilise the |
| 142 // content setting that ensures app banners are not shown for sites which ave | 142 // content setting that ensures app banners are not shown for sites which ave |
| 143 // already been added to homescreen. | 143 // already been added to homescreen. |
| 144 static bool WasLaunchedRecently(Profile* profile, | 144 static bool WasLaunchedRecently(Profile* profile, |
| 145 const GURL& origin_url, | 145 const GURL& origin_url, |
| 146 base::Time now); | 146 base::Time now); |
| 147 | 147 |
| 148 // Set the number of days which dismissing/ignoring the banner should prevent |
| 149 // a banner from showing. |
| 150 static void SetDaysAfterDismissAndIgnoreToTrigger(unsigned int dismiss_days, |
| 151 unsigned int ignore_days); |
| 152 |
| 148 // Set the engagement weights assigned to direct and indirect navigations. | 153 // Set the engagement weights assigned to direct and indirect navigations. |
| 149 static void SetEngagementWeights(double direct_engagement, | 154 static void SetEngagementWeights(double direct_engagement, |
| 150 double indirect_engagement); | 155 double indirect_engagement); |
| 151 | 156 |
| 152 // Set the minimum number of minutes between banner visits that will | 157 // Set the minimum number of minutes between banner visits that will |
| 153 // trigger a could show banner event. This must be less than the | 158 // trigger a could show banner event. This must be less than the |
| 154 // number of minutes in a day, and evenly divide the number of minutes | 159 // number of minutes in a day, and evenly divide the number of minutes |
| 155 // in a day. | 160 // in a day. |
| 156 static void SetMinimumMinutesBetweenVisits(unsigned int minutes); | 161 static void SetMinimumMinutesBetweenVisits(unsigned int minutes); |
| 157 | 162 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 171 | 176 |
| 172 // Returns true if the app banner trigger condition should use the site | 177 // Returns true if the app banner trigger condition should use the site |
| 173 // engagement score instead of the navigation-based heuristic. | 178 // engagement score instead of the navigation-based heuristic. |
| 174 static bool ShouldUseSiteEngagementScore(); | 179 static bool ShouldUseSiteEngagementScore(); |
| 175 | 180 |
| 176 private: | 181 private: |
| 177 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); | 182 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); |
| 178 }; | 183 }; |
| 179 | 184 |
| 180 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ | 185 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ |
| OLD | NEW |