| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 static bool HasSufficientEngagement(double total_engagement); | 123 static bool HasSufficientEngagement(double total_engagement); |
| 124 | 124 |
| 125 // Record a UMA statistic measuring the minutes between the first visit to the | 125 // Record a UMA statistic measuring the minutes between the first visit to the |
| 126 // site and the first showing of the banner. | 126 // site and the first showing of the banner. |
| 127 static void RecordMinutesFromFirstVisitToShow( | 127 static void RecordMinutesFromFirstVisitToShow( |
| 128 content::WebContents* web_contents, | 128 content::WebContents* web_contents, |
| 129 const GURL& origin_url, | 129 const GURL& origin_url, |
| 130 const std::string& package_name_or_start_url, | 130 const std::string& package_name_or_start_url, |
| 131 base::Time time); | 131 base::Time time); |
| 132 | 132 |
| 133 // Returns true if any site under |origin| was launched from homescreen in the |
| 134 // last ten days. This allows services outside app banners to utilise the |
| 135 // content setting that ensures app banners are not shown for sites which ave |
| 136 // already been added to homescreen. |
| 137 static bool WasLaunchedRecently(content::WebContents* web_contents, |
| 138 const GURL& origin_url, |
| 139 base::Time now); |
| 140 |
| 133 // Set the engagement weights assigned to direct and indirect navigations. | 141 // Set the engagement weights assigned to direct and indirect navigations. |
| 134 static void SetEngagementWeights(double direct_engagement, | 142 static void SetEngagementWeights(double direct_engagement, |
| 135 double indirect_engagement); | 143 double indirect_engagement); |
| 136 | 144 |
| 137 // Set the minimum number of minutes between banner visits that will | 145 // Set the minimum number of minutes between banner visits that will |
| 138 // trigger a could show banner event. This must be less than the | 146 // trigger a could show banner event. This must be less than the |
| 139 // number of minutes in a day, and evenly divide the number of minutes | 147 // number of minutes in a day, and evenly divide the number of minutes |
| 140 // in a day. | 148 // in a day. |
| 141 static void SetMinimumMinutesBetweenVisits(unsigned int minutes); | 149 static void SetMinimumMinutesBetweenVisits(unsigned int minutes); |
| 142 | 150 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 156 | 164 |
| 157 // Returns true if the app banner trigger condition should use the site | 165 // Returns true if the app banner trigger condition should use the site |
| 158 // engagement score instead of the navigation-based heuristic. | 166 // engagement score instead of the navigation-based heuristic. |
| 159 static bool ShouldUseSiteEngagementScore(); | 167 static bool ShouldUseSiteEngagementScore(); |
| 160 | 168 |
| 161 private: | 169 private: |
| 162 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); | 170 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); |
| 163 }; | 171 }; |
| 164 | 172 |
| 165 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ | 173 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ |
| OLD | NEW |