| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // Get the recorded event for an event type that only records the last event. | 111 // Get the recorded event for an event type that only records the last event. |
| 112 // Should not be used with APP_BANNER_EVENT_COULD_SHOW. This is only exposed | 112 // Should not be used with APP_BANNER_EVENT_COULD_SHOW. This is only exposed |
| 113 // for testing. | 113 // for testing. |
| 114 static base::Time GetSingleBannerEvent( | 114 static base::Time GetSingleBannerEvent( |
| 115 content::WebContents* web_contents, | 115 content::WebContents* web_contents, |
| 116 const GURL& origin_url, | 116 const GURL& origin_url, |
| 117 const std::string& package_name_or_start_url, | 117 const std::string& package_name_or_start_url, |
| 118 AppBannerEvent event); | 118 AppBannerEvent event); |
| 119 | 119 |
| 120 // Returns true if |total_engagement| is sufficiently high to warrant |
| 121 // triggering a banner, or if the command-line flag to bypass engagement |
| 122 // checking is true. |
| 123 static bool HasSufficientEngagement(double total_engagement); |
| 124 |
| 120 // 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 |
| 121 // site and the first showing of the banner. | 126 // site and the first showing of the banner. |
| 122 static void RecordMinutesFromFirstVisitToShow( | 127 static void RecordMinutesFromFirstVisitToShow( |
| 123 content::WebContents* web_contents, | 128 content::WebContents* web_contents, |
| 124 const GURL& origin_url, | 129 const GURL& origin_url, |
| 125 const std::string& package_name_or_start_url, | 130 const std::string& package_name_or_start_url, |
| 126 base::Time time); | 131 base::Time time); |
| 127 | 132 |
| 128 // Set the engagement weights assigned to direct and indirect navigations. | 133 // Set the engagement weights assigned to direct and indirect navigations. |
| 129 static void SetEngagementWeights(double direct_engagement, | 134 static void SetEngagementWeights(double direct_engagement, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 151 | 156 |
| 152 // Returns true if the app banner trigger condition should use the site | 157 // Returns true if the app banner trigger condition should use the site |
| 153 // engagement score instead of the navigation-based heuristic. | 158 // engagement score instead of the navigation-based heuristic. |
| 154 static bool ShouldUseSiteEngagementScore(); | 159 static bool ShouldUseSiteEngagementScore(); |
| 155 | 160 |
| 156 private: | 161 private: |
| 157 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); | 162 DISALLOW_IMPLICIT_CONSTRUCTORS(AppBannerSettingsHelper); |
| 158 }; | 163 }; |
| 159 | 164 |
| 160 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ | 165 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_SETTINGS_HELPER_H_ |
| OLD | NEW |