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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java

Issue 2735333002: Rename SiteEngagementService::ResetScoreForURL. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 package org.chromium.chrome.browser.engagement; 5 package org.chromium.chrome.browser.engagement;
6 6
7 import org.chromium.base.ThreadUtils; 7 import org.chromium.base.ThreadUtils;
8 import org.chromium.base.annotations.CalledByNative; 8 import org.chromium.base.annotations.CalledByNative;
9 9
10 import org.chromium.chrome.browser.profiles.Profile; 10 import org.chromium.chrome.browser.profiles.Profile;
(...skipping 25 matching lines...) Expand all
36 public double getScore(String url) { 36 public double getScore(String url) {
37 assert ThreadUtils.runningOnUiThread(); 37 assert ThreadUtils.runningOnUiThread();
38 if (mNativePointer == 0) return 0.0; 38 if (mNativePointer == 0) return 0.0;
39 return nativeGetScore(mNativePointer, url); 39 return nativeGetScore(mNativePointer, url);
40 } 40 }
41 41
42 /** 42 /**
43 * Sets the provided URL to have the provided engagement score. 43 * Sets the provided URL to have the provided engagement score.
44 * Must be called on the UI thread. 44 * Must be called on the UI thread.
45 */ 45 */
46 public void resetScoreForUrl(String url, double score) { 46 public void resetBaseScoreForUrl(String url, double score) {
47 assert ThreadUtils.runningOnUiThread(); 47 assert ThreadUtils.runningOnUiThread();
48 if (mNativePointer == 0) return; 48 if (mNativePointer == 0) return;
49 nativeResetScoreForURL(mNativePointer, url, score); 49 nativeResetBaseScoreForURL(mNativePointer, url, score);
50 } 50 }
51 51
52 @CalledByNative 52 @CalledByNative
53 private static SiteEngagementService create(long nativePointer) { 53 private static SiteEngagementService create(long nativePointer) {
54 return new SiteEngagementService(nativePointer); 54 return new SiteEngagementService(nativePointer);
55 } 55 }
56 56
57 /** This object may only be created via the static getForProfile method. */ 57 /** This object may only be created via the static getForProfile method. */
58 private SiteEngagementService(long nativePointer) { 58 private SiteEngagementService(long nativePointer) {
59 mNativePointer = nativePointer; 59 mNativePointer = nativePointer;
60 } 60 }
61 61
62 @CalledByNative 62 @CalledByNative
63 private void onNativeDestroyed() { 63 private void onNativeDestroyed() {
64 mNativePointer = 0; 64 mNativePointer = 0;
65 } 65 }
66 66
67 private static native SiteEngagementService nativeSiteEngagementServiceForPr ofile( 67 private static native SiteEngagementService nativeSiteEngagementServiceForPr ofile(
68 Profile profile); 68 Profile profile);
69 private native double nativeGetScore(long nativeSiteEngagementServiceAndroid , String url); 69 private native double nativeGetScore(long nativeSiteEngagementServiceAndroid , String url);
70 private native void nativeResetScoreForURL( 70 private native void nativeResetBaseScoreForURL(
71 long nativeSiteEngagementServiceAndroid, String url, double score); 71 long nativeSiteEngagementServiceAndroid, String url, double score);
72 } 72 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698