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

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

Issue 1986033002: Implement an observer interface for the site engagement service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@site-engagement-refactor
Patch Set: Address comments Created 4 years, 7 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_OBSERVER_H_
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_OBSERVER_H_
7
8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h"
10
11 class GURL;
12 class SiteEngagementService;
13
14 class SiteEngagementObserver {
15 public:
16 // Called when the engagement for |url| increases to |score|.
17 // This may be run on user input, so observers *must not* perform any
18 // expensive tasks in this callback.
19 virtual void OnEngagementIncreased(const SiteEngagementService* service,
20 const GURL& url,
benwells 2016/06/01 01:44:45 can you use a url::Origin here instead? There is
dominickn 2016/06/01 02:54:13 Do you think that the observer should only be info
benwells 2016/06/01 03:35:50 Hmm ... I hadn't considered that. It feels a bit s
21 double score) {}
22
23 protected:
24 explicit SiteEngagementObserver(SiteEngagementService* service);
25
26 SiteEngagementObserver();
27
28 ~SiteEngagementObserver();
29
30 // Begin observing |service| for engagement increases.
31 // To stop observing, call Observe(nullptr).
32 void Observe(SiteEngagementService* service);
33
34 private:
35 FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, Observers);
36 SiteEngagementService* service_;
37
38 DISALLOW_COPY_AND_ASSIGN(SiteEngagementObserver);
39
40 };
41
42 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698