Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: chrome/browser/banners/app_banner_settings_helper.h

Issue 2024953005: Allow app banners to be triggered by increases in site engagement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@site-engagement-callback
Patch Set: Address reviewer comments. Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_manager.cc ('k') | chrome/browser/banners/app_banner_settings_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698