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

Side by Side Diff: chrome/browser/engagement/site_engagement_service.h

Issue 2778983005: Allow the app banner installability check to run on page load. (Closed)
Patch Set: Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_SERVICE_H_ 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/browser/engagement/site_engagement_metrics.h" 18 #include "chrome/browser/engagement/site_engagement_metrics.h"
19 #include "chrome/browser/engagement/site_engagement_observer.h" 19 #include "chrome/browser/engagement/site_engagement_observer.h"
20 #include "components/history/core/browser/history_service_observer.h" 20 #include "components/history/core/browser/history_service_observer.h"
21 #include "components/keyed_service/core/keyed_service.h" 21 #include "components/keyed_service/core/keyed_service.h"
22 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" 22 #include "third_party/WebKit/public/platform/site_engagement.mojom.h"
23 #include "ui/base/page_transition_types.h" 23 #include "ui/base/page_transition_types.h"
24 24
25 namespace base { 25 namespace base {
26 class Clock; 26 class Clock;
27 } 27 }
28 28
29 namespace banners {
30 FORWARD_DECLARE_TEST(AppBannerManagerBrowserTest,
benwells 2017/03/30 08:22:37 Is this required becaues the test is in a namespac
dominickn 2017/03/30 23:42:52 Yes, unfortunately.
31 CheckOnLoadWithoutSufficientEngagement);
32 }
33
29 namespace content { 34 namespace content {
30 class WebContents; 35 class WebContents;
31 } 36 }
32 37
33 namespace history { 38 namespace history {
34 class HistoryService; 39 class HistoryService;
35 } 40 }
36 41
37 class GURL; 42 class GURL;
38 class HostContentSettingsMap; 43 class HostContentSettingsMap;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, 171 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest,
167 CleanupOriginsOnHistoryDeletion); 172 CleanupOriginsOnHistoryDeletion);
168 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, IsBootstrapped); 173 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, IsBootstrapped);
169 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, EngagementLevel); 174 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, EngagementLevel);
170 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, Observers); 175 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, Observers);
171 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, ScoreDecayHistograms); 176 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, ScoreDecayHistograms);
172 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, LastEngagementTime); 177 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, LastEngagementTime);
173 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, 178 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest,
174 IncognitoEngagementService); 179 IncognitoEngagementService);
175 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, GetScoreFromSettings); 180 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, GetScoreFromSettings);
181 FRIEND_TEST_ALL_PREFIXES(banners::AppBannerManagerBrowserTest,
182 CheckOnLoadWithoutSufficientEngagement);
176 FRIEND_TEST_ALL_PREFIXES(AppBannerSettingsHelperTest, SiteEngagementTrigger); 183 FRIEND_TEST_ALL_PREFIXES(AppBannerSettingsHelperTest, SiteEngagementTrigger);
177 184
178 #if defined(OS_ANDROID) 185 #if defined(OS_ANDROID)
179 // Shim class to expose the service to Java. 186 // Shim class to expose the service to Java.
180 SiteEngagementServiceAndroid* GetAndroidService() const; 187 SiteEngagementServiceAndroid* GetAndroidService() const;
181 void SetAndroidService( 188 void SetAndroidService(
182 std::unique_ptr<SiteEngagementServiceAndroid> android_service); 189 std::unique_ptr<SiteEngagementServiceAndroid> android_service);
183 #endif 190 #endif
184 191
185 // Only used in tests. 192 // Only used in tests.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // A list of observers. When any origin registers an engagement-increasing 304 // A list of observers. When any origin registers an engagement-increasing
298 // event, each observer's OnEngagementIncreased method will be called. 305 // event, each observer's OnEngagementIncreased method will be called.
299 base::ObserverList<SiteEngagementObserver> observer_list_; 306 base::ObserverList<SiteEngagementObserver> observer_list_;
300 307
301 base::WeakPtrFactory<SiteEngagementService> weak_factory_; 308 base::WeakPtrFactory<SiteEngagementService> weak_factory_;
302 309
303 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); 310 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService);
304 }; 311 };
305 312
306 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ 313 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698