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

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

Issue 2553013002: Expose the Site Engagement Service to Java. (Closed)
Patch Set: Clean up. Fix desktop compile Created 4 years 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_SERVICE_ANDROID_H_
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_ANDROID_H_
7
8 #include <jni.h>
9
10 #include "base/android/scoped_java_ref.h"
11 #include "chrome/browser/engagement/site_engagement_service.h"
12
13 // Wrapper class to expose the Site Engagement Service to Java. This class is
14 // owned by the |service_| which it wraps, and is lazily created when
gone 2016/12/07 21:50:26 when...? Intrigued minds want to know.
dominickn 2016/12/08 01:03:54 Oops.
15 class SiteEngagementServiceAndroid {
16 public:
17 static bool Register(JNIEnv* env);
18
19 static SiteEngagementServiceAndroid* GetOrCreate(
20 JNIEnv* env,
21 const base::android::JavaParamRef<jobject>& obj,
22 SiteEngagementService* service);
23
24 explicit SiteEngagementServiceAndroid(
25 JNIEnv* env,
26 const base::android::JavaParamRef<jobject>& obj,
27 SiteEngagementService* service);
gone 2016/12/07 21:50:26 nit: newline here
dominickn 2016/12/08 01:03:54 Done.
28 ~SiteEngagementServiceAndroid();
29
30 double GetScore(JNIEnv* env,
31 const base::android::JavaParamRef<jobject>& obj,
32 const base::android::JavaParamRef<jstring>& jurl);
33
34 void ResetScoreForURL(JNIEnv* env,
35 const base::android::JavaParamRef<jobject>& obj,
36 const base::android::JavaParamRef<jstring>& jurl,
37 double score);
38
39 private:
40 base::android::ScopedJavaGlobalRef<jobject> obj_;
gone 2016/12/07 21:50:26 Use something more descriptive than obj?
dominickn 2016/12/08 01:03:54 Done.
41 SiteEngagementService* service_;
gone 2016/12/07 21:50:26 DISALLOW_COPY_ETC_ETC?
dominickn 2016/12/08 01:03:54 Derp.
42 };
43
44 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698